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/2017-September/149291.html below:

[Python-Dev] PEP 550 v4

[Python-Dev] PEP 550 v4Elvis Pranskevichus elprans at gmail.com
Thu Sep 7 10:01:12 EDT 2017
On Thursday, September 7, 2017 3:54:15 AM EDT Greg Ewing wrote:
> This problem would also not arise if context vars
> simply had names instead of being magic key objects:
> 
>     def foo():
>        contextvars.set("mymodule.myvar", 1)
> 
> That's another thing I think would be an improvement,
> but it's orthogonal to what we're talking about here
> and would be best discussed separately.

On the contrary, using simple names (PEP 550 V1 was actually doing that) 
is a regression.  It opens up namespace clashing issues.  Imagine you 
have a variable named "foo", and then some library you import also 
decides to use the name "foo", what then?  That's one of the reasons why 
we do `local = threading.local()` instead of 
`threading.set_local("foo", 1)`.

                              Elvis
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