Le 29/08/2017 à 21:59, Yury Selivanov a écrit : > > This absolutely needs to be fixed, and the only way (that I know) it > can be fixed is to revert the "every coroutine has its own LC" > statement (going back to the semantics coroutines had in PEP 550 v2 > and v3).
I completely agree with this. What I don't understand is why example #2 can't work the same. > "await bar()" and "await wait_for(bar())" are actually quite > different. Let me illustrate with an example: > > b1 = bar() > # bar() is not running yet > await b1 > > b2 = wait_for(bar()) > # bar() was wrapped into a Task and is being running right now > await b2 > > Usually this difference is subtle, but in asyncio it's perfectly fine > to never await on b2, just let it run until it completes. If you > don't "await b1" -- b1 simply will never run. Perhaps... But still, why doesn't bar() inherit the LC *at the point where it was instantiated* (i.e. foo()'s LC in the examples)? The fact that it's *later* passed to wait_for() shouldn't matter, right? Or should it? Regards Antoine. _______________________________________________ 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