[Python-ideas] New PEP 550: Execution Context

Yury Selivanov yselivanov.ml at gmail.com
Sun Aug 13 12:10:49 EDT 2017


Hi Pau,

Re string keys collisions -- I decided to update the PEP to follow
Nathaniel's suggestion to use a get_context_key api, which will
eliminate this problem entirely.

Re call_soon in asyncio.Task -- yes, it does use ec.run() to invoke
coroutine.send(). However, this has almost no visible effect, as
ExecutionContext.run() is a very cheap operation (think 1-2 function
calls). It's possible to add a new keyword arg to call_soon like
"ignore_execution_context" to eliminate even this small overhead, but
this is something we can easily do later.

Yury


More information about the Python-ideas mailing list