nmatravolgyi <nandor.ma...@gmail.com> added the comment:

I've quickly wanted to create a suitable solution for myself. I made a small 
library with a asyncio.wait_for()-like function using asyncio.wait(). The 
prototype worked, so I put together a small project. When I ran tox and 
realized that this issue with wait_for is only present on py38 and py39 
(possibly py310). The wait_for does not get stuck with py36, py37 and pypy3.

The repo is a little bare bones, but you can run tox after checkout: 
https://github.com/Traktormaster/wait-for2

Right now the tests are set-up that they expect wait_for to get stuck so only 
py38 and py39 passes.

I'm pretty sure the side-effect of returning the future's result when handling 
cancellation is not desired. However I'm not sure how to handle it correctly. 
The repo holds a demo of what I suggested in the beginning of this thread 
(CancelledWithResultError). It works but it is limited.

----------

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

Reply via email to