[Python-Dev] PEP 492: What is the real goal?

Nathaniel Smith njs at pobox.com
Wed Apr 29 22:19:14 CEST 2015


On Wed, Apr 29, 2015 at 1:14 PM, Skip Montanaro
<skip.montanaro at gmail.com> wrote:
>
> On Wed, Apr 29, 2015 at 2:42 PM, Yury Selivanov <yselivanov.ml at gmail.com>
> wrote:
>>
>> Anyways, I'd be OK to start using a new term, if "coroutine" is
>> confusing.
>
>
> According to Wikipedia, term "coroutine" was first coined in 1958, so
> several generations of computer science graduates will be familiar with the
> textbook definition. If your use of "coroutine" matches the textbook
> definition of the term, I think you should continue to use it instead of
> inventing new names which will just confuse people new to Python.

IIUC the problem is that Python has or will have a number of different
things that count as coroutines by that classic CS definition,
including generators, "async def" functions, and in general any object
that implements the same set of methods as one or both of these
objects, or possibly inherits from a certain abstract base class. It
would be useful to have some terms to refer specifically to async def
functions and the await protocol as opposed to generators and the
iterator protocol, and "coroutine" does not make this distinction.

-n

-- 
Nathaniel J. Smith -- http://vorpus.org


More information about the Python-Dev mailing list