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

Dan Rose report at bugs.python.org
Sat May 25 00:22:05 EDT 2019


New submission from Dan Rose <daniel.buchoff at gmail.com>:

Checking membership in `itertools.count()` will either return True in linear time or enter an infinite loop that cannot be terminated with Ctrl-c. This

```
import itertools
1 in itertools.count(0,2)
```

It is expected that the above code will use an efficient (O(1)) membership algorithm like range objects.

----------
components: Library (Lib)
messages: 343452
nosy: Dan Rose
priority: normal
severity: normal
status: open
title: checking for membership in itertools.count enters infinite loop with no way to exit
versions: Python 3.7

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


More information about the New-bugs-announce mailing list