Dynamical scoping

Kay Schluehr kay.schluehr at gmx.net
Tue Jan 15 05:01:06 EST 2008


On 14 Jan., 21:17, George Sakkis <george.sak... at gmail.com> wrote:
> What's the best way to simulate dynamically scoped variables ala
> Lisp ? The use case is an open-ended set of objects that need to
> access the same piece of information (e.g. a  dict, a ConfigParser
> object, a logger etc.). I know that the "proper" OO and functional way
> is to pass the information explicitly but that's less maintenable in
> the long run. Also this is in a web environment so the information
> can't be really global (though within-thread global should be fine).
> Is there some standard pattern for this scenario ?
>
> George

What do you mean by "really global" and why is module local or builtin
a problem
in the presence of the GIL? Passing objects as parameters into
functions doesn't
ensure any more thread safety. Where do you think does Lisp ( which
one? ) stores
dynamically scoped variables?



More information about the Python-list mailing list