Message 413621 - Python tracker (original) (raw)
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.