[Python-Dev] PEP 492: async/await in Python; version 4

Gustavo Carneiro gjcarneiro at gmail.com
Fri May 1 17:55:22 CEST 2015

On 1 May 2015 at 16:31, Guido van Rossum <guido at python.org> wrote:

> On Fri, May 1, 2015 at 5:50 AM, Stefan Behnel <stefan_ml at behnel.de> wrote:
>> Yury Selivanov schrieb am 30.04.2015 um 03:30:
>> > 1. Terminology:
>> > - *native coroutine* term is used for "async def" functions.
>> When I read "native", I think of native (binary) code. So "native
>> coroutine" sounds like it's implemented in some compiled low-level
>> language. That might be the case (certainly in the CPython world), but
>> it's
>> not related to this PEP nor its set of examples.
>> > We should discuss how we will name new 'async def' coroutines in
>> > Python Documentation if the PEP is accepted.
>> Well, it doesn't hurt to avoid obvious misleading terminology upfront.
> I think "obvious[ly] misleading" is too strong, nobody is trying to
> mislead anybody, we just have different associations with the same word.
> Given the feedback I'd call "native coroutine" suboptimal (even though I
> proposed it myself) and I am now in favor of using "async function".

But what if you have async methods?  I know, a method is almost a function,
but still, sounds slightly confusing.

IMHO, these are really classical coroutines.  If gevent calls them
coroutines, I don't think asyncio has any less right to call them

You have to ask yourself this: a new programmer, when he sees mentions of
coroutines, how likely is he to understand what he is dealing with?  What
about "async function"?  The former is a well known concept, since decades
ago, while the latter is something he probably (at least me) never heard of

For me, an async function is just as likely to be an API that is
asynchronous in the sense that it takes an extra "callback" parameter to be
called when the asynchronous work is done.

I think coroutine is the name of a concept, not a specific implementation.


Gustavo J. A. M. Carneiro
Gambit Research
"The universe is always one step beyond logic." -- Frank Herbert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20150501/6752dae4/attachment.html>

More information about the Python-Dev mailing list