[Python-Dev] Re: String substitution: compile-time versus runtime

François Pinard pinard@iro.umontreal.ca
21 Jun 2002 09:58:37 -0400

[Alex Martelli]

> If %(name)s is to be deprecated moving towards Python-3000 (surely it
> can't be _removed_ before then), $-formatting needs a very rich feature
> set; otherwise it can't _replace_ %-formatting.  [...]  The "transition"
> period will thus inevitably offer different ways to perform the same
> tasks [...] the old way and the new way MUST both work together for a
> good while to allow migration.

[Moore, Paul]

> I feel that the existing % formatting operator cannot realistically
> be removed.

I too, like Alex and Paul, have a hard time believing that `%' will
effectively fade out in favour of `$'.  As a few people tried to stress out
(Alex did very well with his anecdote), changes in Python are welcome when
they add real new capabilities, but they are less welcome when they merely
add diversity over old substance: the language is then hurt each time,
loosing bits of simplicity (and even legibility, through the development
of Python subsets in user habits).  Each individual loss may be seen as
insignificant when discussed separately[1], but when the pace of change
is high, the losses accumulate, especially if the cleanup does not occur.

This is why any change in current string interpolation should be crafted
so it fits _very_ naturally with what already exists, and does not look
like another feature patched over other features.  A forever "transition"
period between two interpolation paradigms, foreign to one another, might
give exactly that bad impression.

[1] This is one of the drawback of the PEP system.  By concentrating on
individual features, we loose the vision of all features taken together.
Only Guido has a global vision. :-)

François Pinard   http://www.iro.umontreal.ca/~pinard