PEP 276 Simple Iterator for ints (fwd)

David Eppstein eppstein at ics.uci.edu
Wed Dec 12 00:29:56 CET 2001


In article <3c169178.96189593 at wa.news.verio.net>,
 bokr at accessone.com (Bengt Richter) wrote:

> How about if a bare [x:y:z] were interepreted as an abbreviation for 
> slice(x,y,z)
> and you defined what one might expect as an iterator for the slice type?
> 
> Then you could write
>     for i in [0:5]:   # or [:5]
>         ...

I don't know about the rest of the participants in this discussion, but I 
am not interested in a more concise notation for range() that repeats its 
drawbacks (limited to half-open intervals, non-Pythonists need to look it 
up in the manual in order to understand it).  Why is that any better than 
what we have now?
-- 
David Eppstein       UC Irvine Dept. of Information & Computer Science
eppstein at ics.uci.edu http://www.ics.uci.edu/~eppstein/



More information about the Python-list mailing list