[Python-Dev] Re: *Simpler* string substitutions

Raymond Hettinger python@rcn.com
Fri, 21 Jun 2002 02:18:59 -0400


+1 for $(name) instead of ${name}
           because it is closer to existing formatting spec
           because my tastes like it better

-1 for $(x+y)
            because z=x+y; '$z'.sub() works fine
            because general expressions are harder to pick-out
   
+1 for $(name:fmt)
            because the style is powerful and elegant

+1 for \$ instead of $$        
            because \ is already an escape character
            because $$ is more likely to occur in actual string samples

+1 for 'istring'.sub()  instead of e'istring'
            because sub allows a particular mapping to be specified

+1 for not being a separate module
            so the feature gets used

+1 for leaving %()s alone
           because formats may have been stored external to programs

+1 for not using back-quotes
           because they are hard to read in languages with accents
           because the open and close back-quotes are not distinct


'regnitteh dnomyar'[::-1]