PEP 276 Simple Iterator for ints

David Eppstein eppstein at ics.uci.edu
Wed Nov 14 17:16:41 EST 2001


In article <mailman.1005767000.29645.python-list at python.org>,
 James_Althoff at i2.com wrote:

> [Tim Hochberg]
> >So you can use it in your own class if you want. In particular, one could
> >make
> >
> >int[1,3,...,53] act like range(1,53,2) if one wanted.

I missed this the first time it came around, but here is another argument 
why the current range syntax is not good: it confused Tim.
What you want is for int[1,3,...,53] to act like range(1,54,2) or 
range(1,55,2) -- the final element of the range should be 53 not 51.
-- 
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