Re: [Python-ideas] PEP draft: context variables

2017-10-07 Thread Koos Zevenhoven
Hi all, Thank you for the feedback so far. FYI, or as a reminder, this is now PEP 555, but the web version is still the same draft that I posted here. ​The discussion of this was paused as there was a lot going on at that moment, but I'm now getting ready to make a next version of the draft.​ Bel

Re: [Python-ideas] PEP draft: context variables

2017-10-07 Thread Nathaniel Smith
On Oct 7, 2017 12:20, "Koos Zevenhoven" wrote: ​Unfortunately, we actually need a third kind of generator semantics, something like this: @​contextvars.caller_context def genfunc(): assert cvar.value is the_value yield assert cvar.value is the_value with cvar.assign(the_value):

Re: [Python-ideas] PEP draft: context variables

2017-10-07 Thread Koos Zevenhoven
On Sun, Oct 8, 2017 at 12:16 AM, Nathaniel Smith wrote: > On Oct 7, 2017 12:20, "Koos Zevenhoven" wrote: > > > ​Unfortunately, we actually need a third kind of generator semantics, > something like this: > > @​contextvars.caller_context > def genfunc(): > assert cvar.value is the_value >