Nick Coghlan <ncogh...@gmail.com> added the comment:

The purpose would be two-fold:

1. The presence of the `check_signals()` wrapper provides a way to more 
explicitly document that the other itertools iterators *don't* implicitly check 
for signals, so if you want to combine them with consumers that also don't 
check for signals, then you're going to need to wrap the iterator.

2. As a helper for integration code that's dealing with consumers that don't 
check for signals, but want to make those loops interruptible. Doing that in 
Python (as in my example) is inefficient, since you end up running Python 
bytecode on every iteration, and also don't have as much control over exactly 
when the signals get checked.

Given a solution to issue 33939, I'd drop the priority on this issue to low, 
but I don't think it would make it redundant.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31815>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to