[Python-Dev] Re: Update PEP 292
Tim Peters
tim.peters at gmail.com
Thu Aug 12 07:19:00 CEST 2004
[Barry Warsaw]
> The elimination of the trailing 's' is definitely a benefit, as is the
> adoption of $-placeholders, since that tends to be the placeholder
> introducing character in many other languages. In terms of usability,
> it's a win.
Allowing to skip the {} brackets when they aren't needed is also a win
-- and I expect the most common case.
I do object to this part:
If the $ character appears at the end of the line, or is followed
by any other character than those described above, it is treated
as if it had been escaped, appearing in the resulting string
unchanged.
There's already a facility to escape $, and it's dead easy to use. $
isn't a frequently needed character either in most apps. So escaping
$ "by magic" too is, I think, more likely to make typing errors harder
to find than to do anyone real good.
Better to reserve that magic for the Sloppy^H^H^H^H^H^HSafeTemplate() class.
More information about the Python-Dev
mailing list