[BangPypers] Enclosing lexical context
picachu.nioto at gmail.com
Thu Apr 15 19:46:18 CEST 2010
Thanks for the prompt response Noufal!
Could you explain, in what context is it mentioned here?
On Thu, Apr 15, 2010 at 11:09 PM, Noufal Ibrahim <noufal at gmail.com> wrote:
> On Thu, Apr 15, 2010 at 10:36 PM, Picachu Nioto <picachu.nioto at gmail.com>
> > Could some one explain to me this sentence, I read in an example online
> > "Python doesn't implement assignment of variables bound in an enclosing
> > lexical context"
> > Example,
> > a=[b]
> I'm not sure where you got this sentence means but Python's scoping is
> lexical but has 2 namespaces accessible from the current point of
> execution (locals and globals) which are arguably dynamic. Here's an
> example to show lexical scoping.
> You can see that it prints 1 which is the value of the free identifier
> foo lexically at the point of the print.
> As a counter example, here's an example in Emacs lisp which parallels
> the above but since it's dynamically scoped, the value printed is 2.
> BangPypers mailing list
> BangPypers at python.org
More information about the BangPypers