[Python-Dev] PEP 292, Simpler String Substitutions

Paul Prescod paul@prescod.net
Wed, 19 Jun 2002 09:43:02 -0700


Guido van Rossum wrote:
> 
>...
> 
> I'm strongly in favor of always making missing keys an error.  It
> should be a KeyError when a dict is used, and a NameError when
> locals/globals are looked up.

I think someone later suggested that maybe a keyword argument could
allow some kind of policy to be expressed. That would be okay for me if
people feel strongly that some strategy for fixing up missing arguments
is necessary.

> > Overall it isn't bad...it's a little weird to have a method that depends
> > on sys._getframe(1) (or as the say in Tcl-land "upvar"). It may set a
> > bad precedent...
> 
> No, the real implementation will be in C.  C functions always have
> access to locals and globals.

I didn't mean it will be a bad precedent because of the implemention. I
mean that methods do not usually peak into their caller's variables,
even from C. What other methods do that? I'm still "+0" despite being
somewhat uncomfortable with that aspect.

 Paul Prescod