Re: [Python-Dev] PEP 567 pre v3

2018年1月09日 07:24:03 -0800

2018年01月09日 12:41 GMT+01:00 Yury Selivanov <[email protected]>:
> But I'd be -1 on making all ContextVars have a None default
> (effectively have a "ContextVar.get(default=None)" signature. This
> would be a very loose semantics in my opinion.
Why do you think that it's a loose semantics? For me
ContextVar/Context are similar to Python namespaces and thread local
storage.
To "declare" a variable in a Python namespace, you have to set it:
"global x" doesn't create a variable, only "x = None".
It's not possible to define a thread local variable without specifying
a "default" value neither.
Victor
_______________________________________________
Python-Dev mailing list
[email protected]
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