osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Python-Dev] Addendum to PEP 530


Open an issue at https://github.com/python/steering-council/issues if you
want the steering council to consider something.

On Mon, Mar 4, 2019 at 9:38 AM Serhiy Storchaka <storchaka at gmail.com> wrote:

> PEP 530 introduced support for asynchronous comprehensions.
>
> Comprehensions are implemented as local functions. To make a function
> asynchronous you should to add "async" before "def", and after that you
> can use "async for", "async with" and "await" in a function. But you can
> to do this with comprehensions, since these functions are implicit.
>
> PEP 530 allows to make these function asynchronous by just using
> asynchronous syntax inside. "async with" can not be used in
> comprehensions, but using "async for" or "await" makes the comprehension
> asynchronous.
>
> What PEP 530 missed is that asynchronous comprehensions itself are
> asynchronous constructions which can be used only in asynchronous
> functions.
>
> Issue33346 [1] makes an asynchronous comprehension inside a
> comprehension making the outer comprehension asynchronous as well as
> using explicit "async for" or "await". See details on the issue.
>
> Yury, the author of PEP 530, likes this idea, and there is a ready
> implementation. But making the decision was deferred until a new
> government be stated. Now, after the Steering Council has been elected,
> can it make the decision?
>
> [1] https://bugs.python.org/issue33346
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> https://mail.python.org/mailman/options/python-dev/brett%40python.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20190304/844a49e9/attachment.html>