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/139575.html below:

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

[Python-Dev] PEP 492: async/await in Python; v3 [Python-Dev] PEP 492: async/await in Python; v3Walter Dörwald walter at livinglogic.de
Tue Apr 28 16:23:31 CEST 2015
On 28 Apr 2015, at 5:07, Yury Selivanov wrote:

> Hi python-dev,
>
> Another round of updates.  Reference implementation
> has been updated: https://github.com/1st1/cpython/tree/await
> (includes all things from the below summary of updates +
> tests).
>
> [...]
> New Coroutine Declaration Syntax
> --------------------------------
>
> The following new syntax is used to declare a coroutine::
>
>  async def read_data(db):
>      pass
>
> Key properties of coroutines:
>
> * ``async def`` functions are always coroutines, even if they do not
> contain ``await`` expressions.
>
> * It is a ``SyntaxError`` to have ``yield`` or ``yield from``
> expressions in an ``async`` function.

Does this mean it's not possible to implement an async version of 
os.walk() if we had an async version of os.listdir()?

I.e. for async code we're back to implementing iterators "by hand" 
instead of using generators for it.

> [...]

Servus,
    Walter
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