itertools comments [Was: Re: RELEASED: Python 2.3a2]

Alexander Schmolck a.schmolck at gmx.net
Fri Feb 21 09:01:58 EST 2003


Alex Martelli <aleax at aleax.it> writes:
> 
> > I think xrange, etc. are already a convention for the closest thing
> > Python has traditionally had to iterators.  Maybe those functions
> > should just be updated to make ordinary iterators.
> 
> Not without breaking, e.g., xrange(23, 17923, 12)[15] -- which now
> has a perfectly good result of 203 and would break if xrange
> returned an iterator (or any other non-indexable object).

It could always return and indexable iterator.

alex




More information about the Python-list mailing list