Guido van Rossum <guido@python.org> writes: > The current xrange code (from SF patch #551410) uses the xrange object > as both an iterator and iterable, and has an extra flag to make things > work right when the same object is iterated over more than once. > Without doing more of a review, I can only say that I'm a but > uncomfortable with that approach. Something like the more recent code > that Raymond H added to listobject.c to add a custom iterator makes > more sense. But perhaps it is defensible. The main defense is that the typical use case is for i in xrange(len(some_list)) In that case, it is desirable not to create an additional object, and nobody will notice the difference. Regards, Martin
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4