[issue31815] Make itertools iterators interruptible

Raymond Hettinger report at bugs.python.org
Sun Jun 24 01:19:18 EDT 2018


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> What if itertools were to offer an opt-in ...

This doesn't make sense to me.  As far as I can tell, the only time this issue has ever arisen in the past 15 or 16 years is when someone was trying to create an unbreakable infinite loop on-purpose.  In a way, it is no more interesting than intentionally triggering a seqfault with ctypes or bytecode hacks.  Likewise, it isn't even unique to itertools -- it shows up in any potentially long running C-code such as numpy/scipy calls.

I would like to close this issue and instead go down the path of issue 33939 which would allow consumers to detect when an input expects to be infinite.  The consumers can then decide whether they want to make periodic cntl-c checks.

----------
versions: +Python 3.8 -Python 3.7

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


More information about the Python-bugs-list mailing list