Do you mean that for loops inside an "async def" statements are always executed as 'async for' loops? That's what I wanted to acheive by writing the AsyncDict class (c.f. the CodeReview link).
As I said, I'm pretty new to Asyncio and thus may be missing some immportant feature of the lib (which is apparently the case here). Le lun. 20 août 2018 à 09:29, Nathaniel Smith <n...@pobox.com> a écrit : > On Mon, Aug 20, 2018 at 12:19 AM, Simon De Greve <degreve...@gmail.com> > wrote: > > Hello everyone, > > > > I'm quite new working with asyncio and thus maybe missing some things > about > > it, but wouldn't it be quite easier to have some iterables to support > async > > for loops "natively", since asyncio is now part of the Stdlib? > > > > I've tried to work with asyncio while using discord.py, and has some > > struggle with an "async for" loop on a dictionary, so I had to implement > a > > new dict subclass that would just reimplement items(), keys() and > values() > > functions. > > > > I think that it would be a cool improvement to implement some of those in > > some standard way. There's some code I wrote on a CodeReview thread but I > > still haven't got any feedback on it. > > > > Here's the link of the thread : > > > https://codereview.stackexchange.com/questions/197551/asynchronous-dictionary-in-python > > You can do this, but I don't see what it accomplishes... > > Are you aware that you can use regular 'for' loops inside 'async def' > functions? > > -n > > -- > Nathaniel J. Smith -- https://vorpus.org >
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/