Arnaud Delobelle <[EMAIL PROTECTED]> wrote:

> AFAIK, Python has lexical scoping, with the restriction that
> non-global non-local names cannot be rebound.

I believe so.

It's possible to implement (shallow) dynamic binding as a Python context
manager, though it involves a little unpleasantness with sys._getframe
to get hold of the caller's variables.  See

  http://www.distorted.org.uk/~mdw/hacks/fluid.py

That Python can do this (and fairly simply) speaks well of its
flexibility and dynamic nature.

I don't know how to make it work properly with multi-threading,
unfortunately.

-- [mdw]
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to