Message161449
What fails here is the evaluation of "x", not the assignment!
You are right concerning the assignment, the outer definition has no effect at all. The very presence of "x = " in the function code turns x into a local variable for the whole function; so 'x + "a"' fails because the local variable has not value yet.
Python, unlike Lisp, defines scopes lexically, not dynamically. There is no "previous" binding, but "local" or "outer" scopes. |
|
Date |
User |
Action |
Args |
2012-05-23 18:52:30 | amaury.forgeotdarc | set | recipients:
+ amaury.forgeotdarc, Frederick.Ross |
2012-05-23 18:52:30 | amaury.forgeotdarc | set | messageid: <1337799150.13.0.141984493846.issue14891@psf.upfronthosting.co.za> |
2012-05-23 18:52:29 | amaury.forgeotdarc | link | issue14891 messages |
2012-05-23 18:52:29 | amaury.forgeotdarc | create | |
|