[BangPypers] Does Python have lexical scoping?
senthil at uthcode.com
Sun Nov 9 22:57:07 CET 2014
On Sun, Nov 9, 2014 at 1:14 AM, Noufal Ibrahim KV <noufal at nibrahim.net.in>
> How is lexical scoping with a mutable environment different from dynamic
I think you should post this in python-dev and you might get answers with
Here is my short snippet which shows a behavior which does not indicate a
dynamic binding nature.
x = 10
y = lambda: x
x = 20 # This is not rebinding. It is creating a new local variable by
# But we are referring to x in y function call, so for the
definition of dynamic binding (?)
# should y() see x defined in the local scope instead of the
previously assigned value.
x = 30 # This is rebinding in the same scope.
$ python example.py
More information about the BangPypers