[Python-Dev] async/await in Python; v2

Ludovic Gasc gmludo at gmail.com
Wed Apr 22 23:00:44 CEST 2015


2015-04-22 22:46 GMT+02:00 Victor Stinner <victor.stinner at gmail.com>:
>
> Kind (A):
>
> - "yield-from coroutines" or "coroutines based on yield-from"
> - maybe "asyncio coroutines"
> - "legacy coroutines"?
>

"legacy coroutines" name has the advantage to be directly clear it isn't a
good idea to write new source code with that.


> Kind (B):
>
> - "awaitable coroutines" or "coroutines based on await"
> - "asynchronous coroutine" to remember the "async" keyword even if it
> sounds
> wrong to repeat that a coroutine can be interrupted (it's almost the
> definition of a coroutine, no?)
> - or just "asynchronous function" (coroutine function) & "asynchronous
> object" (coroutine object)
>

Personally, if I've a vote right, "async coroutine" is just enough, even if
it's a repetition. Or just "coroutine" ?
I'm not fan for "new-style coroutines" like name.
By the way, I hope you don't change a third time how to write async code in
Python, because it will be harder to define a new name.

Not related, but one of my coworkers asked me if with the new syntax it
will be possible to write an async decorator for coroutines.
If I understand correctly new grammar in PEP, it seems to be yes, but could
you confirm ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20150422/915d3a86/attachment.html>


More information about the Python-Dev mailing list