Message161449
| Author |
amaury.forgeotdarc |
| Recipients |
Frederick.Ross, amaury.forgeotdarc |
| Date |
2012年05月23日.18:52:29 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1337799150.13.0.141984493846.issue14891@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| 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 |
|