Message 413622 - Python tracker (original) (raw)

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.

Raising multiple CancelledErrors is not the only way to accomplish this. We could store the nonces in a single CancelledError instead.