Python's Lisp heritage

Aahz aahz at pythoncraft.com
Wed Apr 24 00:41:45 EDT 2002


In article <m3662henr9.fsf at chvatal.cbbrowne.com>,
Christopher Browne  <cbbrowne at acm.org> wrote:
>
>If all you have is lexical scoping, parameters have to get explicitly
>passed down the chain in order to get from function A to function C.
>That means introducing additional parameters to function B, which
>didn't actually care about those extra values.

The Pythonic response to this need is to pass a single mutable object
that itself is extensible: list, dict, class/instance, module (this
would actually be a global, mostly).

Oh, I just realized something.  You can use a *class* as a Singleton.
<smirk>  That's probably a better idea than imp.new_module().
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

What if there were no rhetorical questions?



More information about the Python-list mailing list