On Tue, Aug 29, 2017 at 12:59 PM, Yury Selivanov
<yselivanov...@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
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to