Message200809
IDLE tries to be helpful, but it errors on something that isn't yet an error. Pasting in this code works fine:
>>> def a():
def b():
nonlocal q
q+=1
q=1
b()
return q
>>> a()
2
But typing it, line by line, results in an error:
>>> def a():
def b():
nonlocal q
SyntaxError: no binding for nonlocal 'q' found
This doesn't occur with interactive command-line Python. A small issue, more of curiosity value than anything else - I don't have a non-trivial use-case where this causes problems. |
|
Date |
User |
Action |
Args |
2013-10-21 16:30:00 | Rosuav | set | recipients:
+ Rosuav |
2013-10-21 16:30:00 | Rosuav | set | messageid: <1382373000.68.0.189461007664.issue19335@psf.upfronthosting.co.za> |
2013-10-21 16:30:00 | Rosuav | link | issue19335 messages |
2013-10-21 16:30:00 | Rosuav | create | |
|