On Sat, Jul 14, 2012 at 4:29 PM, Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote:
> I don't remember whether it is Javascript or PHP that uses dynamic > binding, but whichever it is, it is generally considered to be a bad > idea, at least as the default or only behaviour. > > Bash is another language with dynamic binding. Some very old versions of > Lisp use dynamic binding, because it was the easiest to implement. Most > modern languages use lexical (also known as static) binding, because it > is more sensible. > > Here is an illustration of the difference: suppose we have two modules, > library.py and main.py: > > # library.py > x = 23 > def func(y): > return x + y > > # main.py > import library > x = 1000 > print func(1) > I've not heard this discussed in a while. ISTR it was "lexical scoping" vs "dynamic scoping", but I wouldn't be surprised at all if it's known by both pairs of names.
-- http://mail.python.org/mailman/listinfo/python-list