Message322755
In the following code :
def g():
return 0
def f():
g = g()
f()
The call to g in f fails due to an UnboundLocalError, while I expected the assignment to hide the global definition of g. Note that if it is done in two subsequent calls, i.e. with :
def f():
goo = g()
g = 0
The first assignment still fails. |
|
Date |
User |
Action |
Args |
2018-07-31 10:51:35 | camshaka | set | recipients:
+ camshaka |
2018-07-31 10:51:35 | camshaka | set | messageid: <1533034295.33.0.56676864532.issue34291@psf.upfronthosting.co.za> |
2018-07-31 10:51:35 | camshaka | link | issue34291 messages |
2018-07-31 10:51:35 | camshaka | create | |
|