[Python-ideas] Letting context managers react to yields inside their scope

Yury Selivanov yselivanov.ml at gmail.com
Thu Apr 30 06:17:54 CEST 2015


On 2015-04-29 11:28 PM, Guido van Rossum wrote:
>> I would also suggest to think about a universal context --
>> >the one that works both for asyncio coroutines and
>> >threadpools they might use.
>> >
>> >This way any framework can implement the context in the
>> >most efficient way.
>> >
>> >All in all, I'm in favor of API and a couple functions
>> >added to the stdlib for this.
>> >
> I'm curious -- how would you access the current contexts?

I tried to find my implementation of context for asyncio
(it was designed and tested to work with
https://codereview.appspot.com/87940044/#ps1) but I
couldn't.  I'll need to spend some time to prototype
this again.  And not as a patch to asyncio, but as a
generic thing.

Yury


More information about the Python-ideas mailing list