[Python-Dev] PEP 292, Simpler String Substitutions

Barry A. Warsaw barry@zope.com
Wed, 19 Jun 2002 08:16:17 -0400

>>>>> "MS" =3D=3D Martin Sj=F6gren <martin@strakt.com> writes:

    MS> What's the advantage of using ${name} and ${country} instead?

There's a lot of empirical evidence that %(name)s is quite error

BTW, you can't use locals() or globals() because you really want
globals()-overridden-with-locals(), i.e.

    d =3D globals().copy()

vars() doesn't cut it either:

>>> help(vars)
Help on built-in function vars:

    vars([object]) -> dictionary
    Without arguments, equivalent to locals().
    With an argument, equivalent to object.__dict__.