This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: set.difference() is not interruptible
Type: behavior Stage:
Components: Interpreter Core Versions: Python 3.7, Python 3.6, Python 3.5, Python 2.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: rhettinger, serhiy.storchaka
Priority: normal Keywords:

Created on 2016-09-12 06:34 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg275977 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-09-12 06:34
>>> from itertools import count
>>> set.difference({0}, count())

This hangs and can't be interrupted by Ctrl-C.
msg275985 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2016-09-12 07:39
This is no different than the many other places in Python where you can tell the language to go on an infinite wild goose chase:  sum(count()), list(count()), etc.  I believe there is already a tracker item open for such things.  Someone is going to have to make a decision whether to slow-down every single possible input source, or slow-down every possible consumer, or to just punt, because this never comes up in practice.
History
Date User Action Args
2022-04-11 14:58:36adminsetgithub: 72283
2016-09-12 07:39:42rhettingersetstatus: open -> closed
resolution: duplicate
messages: + msg275985
2016-09-12 06:34:57serhiy.storchakacreate