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

Glenn Linderman v+python at g.nevcal.com
Sat May 2 04:55:24 CEST 2015


On 5/1/2015 9:59 AM, Guido van Rossum wrote:
>
>     I think coroutine is the name of a concept, not a specific
>     implementation.
>
>     Cheers,
>
>  Cheers indeed! I agree that the *concept* is best called coroutine -- 
> and we have used this term ever since PEP 342. But when we're talking 
> specifics and trying to distinguish e.g. a function declared with 
> 'async def' from a regular function or from a regular generator 
> function, using 'async function' sounds right. And 'async method' if 
> it's a method.

Exactly. The async function/method is an implementation technique for a 
specific kind/subset of coroutine functionality.  So the term coroutine, 
qualified by a description of its best usage and limitationsof async 
function, can be used in defining async function, thus appealing to what 
people know or have heard of and vaguely understand and can read more 
about in the literature.

A glossary entry for coroutine in the docs seems appropriate, which 
could point out the 16† ways to implement coroutine-style 
functionalities in Python, and perhaps make recommendations for 
different types of usage.

†OK, not 16 ways, but it is 3 now, or 4?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20150501/36835a37/attachment.html>


More information about the Python-Dev mailing list