On 04/29/2018 01:20 PM, Tim Peters wrote:

So, e.g.,

"""
a = 42

def showa():
     print(a)

def run():
     global a

     local a: # assuming this existed
         a = 43
         showa()
     showa()
"""

would print 43 and then 42.  Which makes "local a:" sound senseless on
the face of it ;-)  "shadow" would be a more descriptive name for what
it actually does.

Yeah, "shadow" would be a better name than "local", considering that it effectively temporarily changes what other functions see as global. Talk about a debugging nightmare! ;)

--
~Ethan~
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to