[Python-Dev] statically nested scopes
Guido van Rossum
Thu, 02 Nov 2000 02:51:15 -0500
> Saw that. I was just thinking that locals() already does what
> vars()-no-args does, so why have two ways to do the same thing?
Not clear -- maybe one of them needs to be made obsolete.
> GvR> I don't think you need to have a mechanism to find all
> GvR> accessible names; I don't see a common use for that. It's
> GvR> sufficient to have a mechanism to look up any specific name
> GvR> according to whatever mechanism we decide upon. This is
> GvR> needed for internal use of course; it can also be useful for
> GvR> e.g. variable substitution mechanisms like the one you
> GvR> recently proposed or Ping's Itmpl.
> Ah, something like this then:
I'm not sure that the mechanism provided should follow the mapping
API. *All* it needs to do it provide lookup capability. Having
.keys(), .items(), .has_key() etc. just slows it down.
--Guido van Rossum (home page: http://www.python.org/~guido/)