[Python-3000] PEP - string.format

Raymond Hettinger rhettinger at ewtllc.com
Fri Apr 21 23:39:54 CEST 2006


>- I like having an operator for string formatting. I'm -0 on dropping it for
>a .format() method.
>  
>

I'm +1 on some sort of change from the current %-operator which has 
issues distinguishing between scalar and collection arguments.  Also, 
there are precedence issues (the current precedence is a vestige of % 
being used for modular arithmetic -- it is not the precedence we would 
have chosen otherwise).  Also, the docs for %-formatting are more 
difficult to find because we use an operator instead of a named method.  
Lastly, the %-operator is not visually distinct from the %-symbols used 
in the adjacent format string.  IMO, a named method solves all of these 
issues.


Raymond


More information about the Python-3000 mailing list