[Python-Dev] PEP 215 redux: toward a simplified consensus?

Barry A. Warsaw barry@zope.com
Mon, 25 Feb 2002 16:44:02 -0500


>>>>> "SM" == Skip Montanaro <skip@pobox.com> writes:

    SM> I'm still not at all fond of the $-string idea, but in the
    SM> interests of completeness, perhaps using '$' as a binary
    SM> operator (by analogy with '%' as a binary operator having
    SM> nothing to do with modulo when the left arg is a string) would
    SM> be appropriate.

I can't say whether it's a good thing to add this to the language or
not.  I tend to think that %(var)s is just fine from a Python
programmer's point of view, and in the interest of TOOWTDI, we don't
need anything else.

>From a /non-programmer's/ point of view, %(var)s is way too error
prone, and $-strings are an attempt at implementing a simple to
explain, hard to get wrong, rule for thru-the-web supplied template
strings.  There's been no usability testing yet to know whether
$-strings actually will be easier to use <wink>, but I've got plenty
of anecdotal evidence that %-strings suck badly for useability by
non-Python programmers.

Still, if $-strings are better for non-programmers, maybe they're
better for programmers too.  There's certainly evidence that
translators get them wrong too.
-Barry