Joongi Kim <m...@daybreaker.info> added the comment:

>From the given example, if I add "await q.aclose()" after "await 
>q.asend(123456)" it does not leak the memory.

This is a good example showing that we should always wrap async generators with 
explicit "aclosing" context manager (which does not exist yet in the stdlib).
I'm already doing so by writing a custom library:
https://github.com/achimnol/aiotools/blob/ef7bf0ce/src/aiotools/context.py#L152

We may need to update the documentation to recommend explicit aclosing of async 
generators.

----------
nosy: +achimnol

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

Reply via email to