On 2017-12-23 04:01, Peng Yu wrote:
Hi, The following example shows that both locals() and globals() are
updated when x and f are defined. Shouldn't they be considered and
global variable and functions only? Why does it make sense to set
locals() as well? Thanks.

It's "local" in the sense that it's in the current scope, so in a function it's local to that function, and in the main code of a module it's local to that module as well as being "global".

[snip]
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to