string formatting documentation
Alan G Isaac
alan.isaac at gmail.com
Mon Jan 19 09:44:01 EST 2009
On 1/17/2009 3:59 PM Ned Deily apparently wrote:
> <http://docs.python.org/3.0/library/stdtypes.html#old-string-formatting-operations>
Ah, so the rumors are true:
we are supposed to prefer
'{0:>10}'.format('wtf?')
to
'%10s' % 'wtf?'
and
'{{0}}{0}'.format('wtf?').format('wtf?')
to
'%%s%s' % 'wtf?' % 'wtf?'
According to PEP 4,
"obsolete" means "deprecated".
So the compact, simple, and useful
old string formatting is really deprecated?
Ouch.
Thanks,
Alan Isaac
More information about the Python-list
mailing list