[issue46752] Introduce task groups to asyncio and change task cancellation semantics

Dan Halbert report at bugs.python.org
Wed Feb 16 10:29:01 EST 2022


Dan Halbert <halbert at halwitz.org> added the comment:

For your TODO list (not sure how else to communicate this):

I agree with the de-emphasis of gather(). I think adding another version of gather() that cancels all the remaining tasks if one fails would also be good, unless you think it is completely redundant due to TaskGroups. This idea was originally mentioned in https://bugs.python.org/issue31452 as a bug, and determined to be "works as designed". So now making an all-cancel() version of gather() is an idiom that people keep recoding, e.g. https://stackoverflow.com/questions/59073556/how-to-cancel-all-remaining-tasks-in-gather-if-one-fails.

----------
nosy: +dhalbert

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


More information about the Python-bugs-list mailing list