Python 3: range objects cannot be sliced

Alan G Isaac alan.isaac at gmail.com
Fri Jan 16 19:36:34 CET 2009


On 1/16/2009 1:15 PM Paul Rubin apparently wrote:
> range is an iterator now.  Try itertools.islice.

Well yes, it behaves like xrange did.
But (also like xrange) it supports indexing. (!)
So why not slicing?
I expected this (to keep it functionally
more similar to the old range).

Alan Isaac



More information about the Python-list mailing list