Vytautas Liuolia <vytautas.liuo...@gmail.com> added the comment:

I've now skimmed through the relevant Trio issue 
https://github.com/python-trio/trio/issues/265 and the currently deferred 
https://www.python.org/dev/peps/pep-0533/ and, as I understand, the issue is 
not trivial and subject to subtle edge cases.

Getting back to the issue, it looks like a misunderstanding on my side, sorry!

As per PEP-525:

    The asyncio event loop will use sys.set_asyncgen_hooks() API to maintain a 
weak set of all scheduled asynchronous generators, and to schedule their 
aclose() coroutine methods when it is time for generators to be GCed.

It seems that my original test case just doesn't give these aclose() coroutines 
a chance to run. Awaiting an asyncio.sleep() "fixes" that.

----------

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

Reply via email to