[issue46771] Add some form of cancel scopes

Sam Bull report at bugs.python.org
Sun Feb 20 19:19:10 EST 2022


Sam Bull <m6f6g7 at sambull.org> added the comment:

Actually, in your counter proposal, you say:

> Such context managers should still keep track of whether they cancelled the task themselves or not, and if they did, they should always call t.uncancel().

But, if we are using nonces on the CancelledError to keep track, then only 1 context manager will know if it was themselves or not. This is exactly why I'm proposing to use multiple CancelledErrors, so that every nonce is passed to the handling code.

----------

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


More information about the Python-bugs-list mailing list