Message372707
> 1) We should alter code in symtable.c to check whether the namespace in which the nonlocal statement appears in is a function block and whether it is nested or not.
We already raise in this case. Consider this 'test.py' file:
x = 34
def f():
nonlocal x
x = 24
f()
Executing python test.py:
File "test.py", line 3
nonlocal x
^
SyntaxError: no binding for nonlocal 'x' found |
|
Date |
User |
Action |
Args |
2020-06-30 17:26:55 | pablogsal | set | recipients:
+ pablogsal, terry.reedy, ncoghlan, r.david.murray, Mark.Shannon, Rosuav, Esa.Peuha, mbussonn, cheryl.sabella, lys.nikolaou, RJ722 |
2020-06-30 17:26:55 | pablogsal | set | messageid: <1593538015.42.0.705992959905.issue19335@roundup.psfhosted.org> |
2020-06-30 17:26:55 | pablogsal | link | issue19335 messages |
2020-06-30 17:26:55 | pablogsal | create | |
|