Le 29/08/2017 à 22:20, Yury Selivanov a écrit :
> 
> 2)
> 
>    gvar = new_context_var()
>    var = new_context_var()
> 
>    async def bar():
>        # EC = [current_thread_LC_copy, Task_foo_LC_copy, Task_wait_for_LC]

Ah, thanks!...  That explains things, though I don't expect most users
to spontaneously infer this and its consequences from the fact that they
used "wait_for()".

This seems actually even more problematic, because if bar() can mutate
Task_wait_for_LC, it may unwillingly affect wait_for() (assuming the
wait_for() implementation may some day use EC for whatever purpose, e.g.
logging).

It seems framework code like wait_for() should have a way to override
the default behaviour and remove their own LC's from "child" coroutines'
lookup chaines.  Perhaps the PEP already allows for his?

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

Reply via email to