John Belmonte <j...@neggie.net> added the comment:

Adding this would be a nice compliment to aclosing(), which was already merged 
for 3.10.

Otherwise, witness the ugliness of using aclosing() with an async iterable 
object:

    async with aclosing(foo.__aiter__()) as agen:
        async for item in agen:
            ...

I'd like:

    async with aclosing(aiter(foo)) as agen:
        async for item in agen:
            ...

----------
nosy: +John Belmonte

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

Reply via email to