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

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


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

    BAW> There's been no usability testing yet to know whether
    BAW> $-strings actually will be easier to use <wink>, but I've got
    BAW> plenty of anecdotal evidence that %-strings suck badly for
    BAW> useability by non-Python programmers.

    SM> I presume your anecdotal evidence comes from Mailman.

Correct.
    
    SM> If you have a pair of functions that implement the %-to-$-to-%
    SM> transformation and can catch the missing 's' problem
    SM> automatically (is that the biggest problem non- programmers
    SM> have?),

The biggest, yes, but not necessarily the only one.
    
    SM> then why not just use this in Mailman and be done with the
    SM> problem?

That's what I plan on doing for MM2.1, except I won't force it down
people's throats yet.  It'll be optional (but it'll be an either-or
option).  I won't use it in Python code yet though (too disruptive),
just the thru-the-web template defining text-boxes.
    
    SM> In fact, why not just document Mailman so that "%(var)" is the
    SM> correct form and silently add the "missing" 's' in your
    SM> transformation step?

    SM> That %-strings suck for Mailman administrators does not mean
    SM> they necessarily suck for programmers.

True, but who knows?  I wouldn't necessarily classify python-dev as a
representative sample of users.
    
    SM> The two populations obviously overlap somewhat, but not
    SM> tremendously.  I have never had a problem with %-strings,
    SM> certainly not with omitting the trailing 's'.  Past experience
    SM> with printf() doesn't obviously pollute the sample population
    SM> too much either, since the %(var)s type of format is not
    SM> supported by printf().

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

    SM> What do you mean by "translators"?

Someone who is fluent in a natural language other than English, and
translates a catalog of English source strings to a target non-English
natural language.  E.g.

    "No such list: %(listname)s" -> "Non esiste la lista: %(listname)s"

-Barry