30 Apr
2018
30 Apr
'18
1:20 a.m.
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~