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/2019-May/157731.html below:

[Python-Dev] [SPAM?] Re: PEP 558: Defined semantics for locals()

[Python-Dev] [SPAM?] Re: PEP 558: Defined semantics for locals() [Python-Dev] [SPAM?] Re: PEP 558: Defined semantics for locals()Terry Reedy tjreedy at udel.edu
Mon May 27 09:12:40 EDT 2019
On 5/27/2019 3:18 AM, Greg Ewing wrote:
> Chris Angelico wrote:
>> Except that it does. After calling locals() a second time, the result
>> of the *first* call will be updated to reflect changes.
> 
> Yeow. That's *really* unintuitive. There had better be an extremely
> good reason for this behaviour.

I believe that the situation is or can be thought of as this: there is 
exactly 1 function locals dict.  Initially, it is empty and inaccessible 
(unusable) from code.  Each locals() call updates the dict to a current 
snapshot and returns it.


-- 
Terry Jan Reedy

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