nested scopes

Rainer Deyke root at rainerdeyke.com
Tue Feb 6 15:10:03 EST 2001


"Michael Hudson" <mwh21 at cam.ac.uk> wrote in message
news:m3r91b3b5b.fsf at atrus.jesus.cam.ac.uk...
> It's good when you're calling a function (call it A) that calls
> another function (call this one B) that has parameterizable behaviour,
> because A doesn't have to put all of B's parameters in its argument
> list - you get B to read these paramters from special (ie. dynamically
> scoped) variables and bind them around your call to A.  Can't think of
> a real good example now, I'm afraid.  The Common Lisp printer uses
> special variables extensively.

Some Python functions (including 'globals' and 'locals') have behavior
similar to that of dynamic scoping.


--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor





More information about the Python-list mailing list