[Python-ideas] async/await in Python

Yury Selivanov yselivanov.ml at gmail.com
Mon Apr 20 05:10:13 CEST 2015


Hi Greg,

I added a section about PEP 3152 to PEP 492:
https://hg.python.org/peps/rev/428c7c753500

Please take a look, and feel free to correct me if I
made any mistakes or forgot to specify something.

Thank you,
Yury

On 2015-04-17 8:21 PM, Greg Ewing wrote:
> Yury Selivanov wrote:
>>
>> Here's my proposal to add async/await in Python.
>
> You've essentially reinvented PEP 3152 - Cofunctions.
>
> https://www.python.org/dev/peps/pep-3152/
>
> Here's a summary of the relationships between them:
>
> PEP 3152                  Nearest equivalent in Yury's PEP
> --------                  --------------------------------
>
> codef f(args):            async def f(args):
>
> cocall f(args)            await f(args)
>
> __cocall__                __await__
>
> costart()                 async_def()
>
> There is currently no equivalent of "async for" and
> "async with" in PEP 3152, but they could easily be added.
> I would probably spell them "cofor" and "cowith".
>
> As the author of PEP 3152 I'm obviously biased, but I
> think my spellings are more elegant and less disruptive
> to reading of the code.
>
> PEP 3152 is currently marked as deferred. Maybe it's
> time to revive it? If Yury's pep is to be considered,
> we ought to discuss the relative merits of the two.
>



More information about the Python-ideas mailing list