On 08/23/2017 12:17 PM, Yury Selivanov wrote:
How about ExecutionContext and ContextVars ?
We are already used to different levels of variables: global, local, non-local,
class. I think having variables tied to a Context, and having search flow back
to previous Contexts, would be easy to understand.
Yeah, I had this idea about ContextVars and so far I like it more than
Context Keys and Context Values.
In the next version of the PEP (will post it soon), we use Execution
Context, Logical Context, and Context Variable terminology (the debate
if we should use other names is, of course, still open).
ContextVars is actually a different name for LogicalContext. So it would be:
ExecutionContext = [ContextVars()[, ContextVars()[ ...]]]
and you get the (thread.local similar) ContextVars by
context_vars = sys.get_context_vars() # or whatever
context_vars.verbose = ...
--
~Ethan~
_______________________________________________
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