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 _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com