[Python-ideas] PEP 530: Asynchronous Comprehensions

Sven R. Kunze srkunze at mail.de
Tue Sep 6 15:27:22 EDT 2016


On 06.09.2016 20:45, Koos Zevenhoven wrote:
> On Tue, Sep 6, 2016 at 9:24 PM, Sven R. Kunze <srkunze at mail.de> wrote:
> [...]
>> No really, I have absolutely no idea why you need to put that "async" in all
>> places where Python can detect automatically if it needs to perform an async
>> iteration or not. Maybe, Yury can explain.
> I'm sure he would explain, but it seems I was first ;) [last-minute
> edit: no, Nick was first, but this is a slightly different angle].
>
> First, the "async" gets inherited from PEP 492, so this has actually
> already been decided on. While not strictly necessary for a syntax for
> "async for", it makes it more explicit what happens under the hood --
> that __a*__ methods are called and awaited, instead of simply calling
> __iter__/__next__ etc. as in regular loops/comprehensions.
>
> Not a lot to debate, I guess. No surprises here, just implementation work.

Of course, I would do the same. I value consistency a lot (but the issue 
here remains). :)


Cheers,
Sven


More information about the Python-ideas mailing list