[issue2690] Precompute range length

Nick Coghlan report at bugs.python.org
Tue Apr 29 13:40:20 CEST 2008


Nick Coghlan <ncoghlan at gmail.com> added the comment:

It also isn't what range() and xrange() are used for now in 2.x. range()
returns an actual list, hence is limited to sequences that fit in a
reasonable amount of memory, and xrange() doesn't support values greater
than sys.maxint at all (as it uses C ints for its internal storage of
the start, stop and step values).

With itertools.count() available for the unbounded iterator case, I
think making range() mimic its 2.x counterpart as closely as possible
(without the memory inefficiency) will be quite valuable.

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2690>
__________________________________


More information about the Python-bugs-list mailing list