A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2015-April/139357.html below:

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

[Python-Dev] async/await in Python; v2 [Python-Dev] async/await in Python; v2Greg Ewing greg.ewing at canterbury.ac.nz
Wed Apr 22 08:05:19 CEST 2015
Yury Selivanov wrote:
> 1. CO_ASYNC flag was renamed to CO_COROUTINE;
> 
> 2. sys.set_async_wrapper() was renamed to
>    sys.set_coroutine_wrapper();
> 
> 3. New function: sys.get_coroutine_wrapper();
> 
> 4. types.async_def() renamed to types.coroutine();

I still don't like the idea of hijacking the generic
term "coroutine" and using it to mean this particular
type of object.

> 2. I propose to disallow using of 'for..in' loops,
>    and builtins like 'list()', 'iter()', 'next()',
>    'tuple()' etc on coroutines.

PEP 3152 takes care of this automatically from the fact
that you can't make an ordinary call to a cofunction,
and cocall combines a call and a yield-from. You have
to go out of your way to get hold of the underlying
iterator to use in a for-loop, etc.

-- 
Greg

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4