[Python-ideas] More useful slices (original) (raw)

Skip Montanaro skip.montanaro at gmail.com
Mon Feb 2 14:45:51 CET 2015


I'm partial to

for i in 1...10: pass myself.

You have to handle step size != 1 in the loop.

I'm +0 on the whole idea of repurposing/creating syntax for range(). On the one hand, I think the syntactic sugar can be kind of handy, and runtime optimization of loop constructs is likely to be a bit better. OTOH, I doubt the presence of a call to range() vs. a fixed chunk of syntax is a big impediment to the PyPy folks and others interested in optimizing Python performance.

Skip -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150202/c1c40fe9/attachment.html>



More information about the Python-ideas mailing list