18 Feb
2009
18 Feb
'09
2:20 a.m.
On Tue, 17 Feb 2009 10:32:17 -0800, Guido van Rossum wrote:
You can do similar things with .format(), but inside {} the : and ! characters always end the key.
Why not keep something like str.old_format(formatcode, tuple_or_object) for py3k for backward compatibility purpose, then completely removing it on python 4.0? Add a note that .old_format is obsolete and would be removed and codes should use the newer formatters. That way 2to3 tool would become simpler (just convert most things to old_format). While for the most common use cases (e.g. 'old%sliteral' % item), it can automatically be converted it to 'new{}literal'.format(item) or $- substitution.