[Python-ideas] PEP 530: Asynchronous Comprehensions

Matthias welp boekewurm at gmail.com
Sat Sep 3 20:55:46 EDT 2016


> In principle, asynchronous generator expressions are allowed in
> any context.  However, in Python 3.6, due to ``async`` and ``await``
> soft-keyword status, asynchronous generator expressions are only
> allowed in an ``async def`` function.  Once ``async`` and ``await``
> become reserved keywords in Python 3.7 this restriction will be
> removed.

Would this mean that with this PEP I can write a for loop like this?

    for (await?) item in async_generator():
        ... code

Or am I misunderstanding something?


footnote: I am not really up to date with the async PEPs, so
please correct me if this has already been discussed
somewhere else.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160904/195ab375/attachment-0001.html>


More information about the Python-ideas mailing list