On Wed, Apr 09, 2014 at 02:40:21PM -0400, Geoffrey Spear wrote: > Of course, this raises the question of whether making slice assignment > not go into an infinite loop when the programmer asks it to is a > bugfix or a new feature. Definitely a new feature. > Calling: > > list(itertools.cycle([0])) > > exhibits the same behavior for the same reason, and I don't think > anyone would call that a bug in Python. It's not a bug, nevertheless it is a problem that can be amiliated. Some objects now have a __length_hint__ method. cycle could use that to indicate that it was infinitely long, and list could raise an exception *before* consuming all available memory. http://legacy.python.org/dev/peps/pep-0424/ -- Steven
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