1 Jul 2004 04:17
RE: PEP 276 (simple iterator for ints)
Greg Ewing <greg <at> cosc.canterbury.ac.nz>
2004-07-01 02:17:15 GMT
2004-07-01 02:17:15 GMT
"Chermside, Michael" <mchermside <at> ingdirect.com>:
> >>> for i in len(myList):
> ... doSomethingWithIndexes(i)
>
> is simple and elegant.
IMO it would be clearer, and equally elegant, to write
this as something like
for i in indices(myList):
...
which is easily accomplished with the aid of a suitable
definition for indices(). No language changes needed.
I suspect most people other than number theorists would
find the concept of a set of integers being contained
in another integer quite wierd.
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury, | A citizen of NewZealandCorp, a |
Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. |
greg <at> cosc.canterbury.ac.nz +--------------------------------------+
_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org
(Continue reading)
. In particular, I'd
suggest adding some text to the documentation on codecs.open() which
points out that read and readlines and friends will in fact return
Unicode objects.
I assume, though, that the args to "read()" and friends are still
about bytes.
>> Any file that is not explicitly opened as binary (with the 'b' flag
>> (and, by the way, why isn't the 'b' flag the default for file opening?
> Because it isn't in C.
That's probably why Python doesn't have list comprehensions, either
RSS Feed