A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2018-January/151638.html below:

[Python-Dev] PEP 567 v2

[Python-Dev] PEP 567 v2 [Python-Dev] PEP 567 v2Elvis Pranskevichus elprans at gmail.com
Fri Jan 5 18:23:34 EST 2018
On Friday, January 5, 2018 5:43:24 PM EST Chris Jerdonek wrote:
> Is there a reason ContextVar needs to be exposed publicly at all?  For
> example, the API could use string keys like contextvars.get(name) or
> Context.get(name) (class method). There could be separate functions
> to initialize keys with desired default values, etc (internally
> creating ContextVars as needed).

Mainly because the design of contextvars follows the spirit of 
threading.local() (but see [1]).  A ContextVar is not unlike a global 
variable, and we don't normally write globals()['foo'].

                              Elvis


[1] https://www.python.org/dev/peps/pep-0550/#replication-of-threading-local-interface

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4