[issue37040] checking for membership in itertools.count enters infinite loop with no way to exit

SilentGhost report at bugs.python.org
Sat May 25 02:33:08 EDT 2019


SilentGhost <ghost.adh at runbox.com> added the comment:

This seem like a misdirected expectation. count returns a regular iterator and the purpose behind it is not to enable membership checks, this only works because it's a regular iterators and normal rules for checking membership are applied.

In any case, it is possible to write an infinite loop in Python either by accident or intentionally, this doesn't seem like a reasonable rationale for making this sort changes.

----------
nosy: +SilentGhost, rhettinger
resolution:  -> rejected
stage:  -> resolved
status: open -> closed
type:  -> behavior
versions: +Python 3.8 -Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37040>
_______________________________________


More information about the Python-bugs-list mailing list