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/2017-August/149062.html below:

[Python-Dev] PEP 550 v4: coroutine policy

[Python-Dev] PEP 550 v4: coroutine policy [Python-Dev] PEP 550 v4: coroutine policyNathaniel Smith njs at pobox.com
Tue Aug 29 16:18:51 EDT 2017
On Tue, Aug 29, 2017 at 12:59 PM, Yury Selivanov
<yselivanov.ml at gmail.com> wrote:
>     b2 = wait_for(bar())
>     # bar() was wrapped into a Task and is being running right now
>     await b2

Ah.... not quite. wait_for is itself implemented as a coroutine, so it
doesn't spawn off bar() into its own task until you await b2.

Though according to the docs you should pretend that you don't know
whether wait_for returns a coroutine or a Future, so what you said
would also be a conforming implementation.

-n

-- 
Nathaniel J. Smith -- https://vorpus.org
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