Andrew Svetlov <andrew.svet...@gmail.com> added the comment:

> the third case the behavior is wrong, the `.cancel()` should win over the 
> timeout. Otherwise using the context manager becomes too risky in real-world 
> situations.

Please elaborate. The first code that calls `.cancel()` wins, doesn't matter 
what is the source. asyncio has no priorities.

> I also think your first graph has an issue if the user has a `try/except 
> TimeoutError` between `timeout-a` and `timeout-b`, which is now more probable 
> since we're dropping `move_on`. We can take the discussion to the forked 
> repo; I can put together some tests if that would make it easier.

Ok, let's discuss on GitHub. I only would mention that no code could be 
executed between timeout-a and timeout-b, because both events are scheduled 
between the previous event loop iteration and the current one.
Sure, if we can start talking with code (and failed tests) -- it can raise the 
understanding level very much.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46771>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to