PEP 276 -- What else could iter(5) mean?
peter at engcorp.com
Sun Mar 3 04:02:22 CET 2002
"Cromwell, Jeremy" wrote:
> If python was to allow "for i in 5:", is there any other meaning that would
> be appropriate besides the one detailed in PEP 276?
Certainly, at least to a newcomer.
I think I would expect that to do either the same as "for i=1 to 5: next"
or to just do "5" only. After all, if I have a list of things and
"for" iterates through them, then wouldn't it make sense for a scalar
to result in iteration over only one item?
(I don't care to argue, but you asked and I believe both those
could be considered "appropriate". I'm not the BDFL though.)
More information about the Python-list