You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lib ref manual 2.1 builtin funcs: locals() says
"Return a dictionary representing the current local
symbol table"
This can be (and has been, by experience users)
interpreted as "return a *new* dictionary..."
It would better describe current behavior if it said:
"Update and return the dictionary...."
This would make the following less surprising:
>>> deff():
... foo ='bar'
... a =locals()
... a['foo'] ='Guido'
... try: print a['a']
... except: print"'a' is not in a"
... print a['foo'], locals()['foo'], a['foo'], a['a']
...
>>> f()
'a' is not in a
Guido bar bar {'a': {...}, 'foo': 'bar'}
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: