[Python-3000] String formating operations in python 3k

John J Lee jjl at pobox.com
Wed Apr 5 21:12:31 CEST 2006


[Greg Ewing]
> I'm more interested in long-term readability
> and maintainability than in pandering to one-off
> impressions when coming from another language.

[Ian Bicking]
> $-based substitution is very common.  Like most languages, Python uses
> () for calling functions, it uses keywords like "while" and "if", etc.
> It's okay to use the normal form; tweaking some detail off the norm
> because it seems slightly more compact or concise seems questionable to
> me.  Using {} instead of $/${} doesn't seem like a big win.

Well, if you're interested in precedents, I guess it depends on the 
audience you're most concerned with:

MS Word, when you use its Mail Merge feature, uses European-style quotes 
(which look a bit like a scaled-down version of <<quoted>>) -- at least, 
that's what it does on my PC.  I guess the *potential* audience for whom 
that's the most familiar interpolation syntax is much larger than the 
number of people coming from other programming languages.  Presumably if, 
like Guido, you have an interest in making programming languages 
accessible to a wider audience, this might by your own (Ian's) argument 
favour Greg's proposed syntax.

FWIW, ReportLab's "preppy" templating system uses {{expression}}, which 
ISTR was inspired by MS's choice (and if it wasn't, it should have been 
;-).


John


More information about the Python-3000 mailing list