[Python-3000] str.format() -- poss. code or doc bug?
brett at python.org
Fri Nov 30 20:38:32 CET 2007
On Nov 30, 2007 9:37 AM, Guido van Rossum <guido at python.org> wrote:
> On Nov 30, 2007 8:08 AM, Mark Summerfield <mark at qtrac.eu> wrote:
> > Your reply seems to imply that Python 3 will have 3 different and
> > overlapping ways of formatting strings: %, str.format(), and
> > string.Template. If that is the case, it seems like overkill to me:-)
> IMO string.Template is a dead experiment.
> My original plan was to get rid of % in favor of str.format(). This
> seems to have run into objections from folks who don't want to have to
> change their code. They have a point: when the string is not a
> literal, it's not possible for 2to3 to automatically convert x%y to a
> .format() call. So perhaps we should deprecate % formatting and get
> rid of it at some later time.
+1 from me on starting a PendingDeprecationWarning in 3.0 and a
DeprecationWarning move on % formatting once Python 3 has stabilized
(I know you have said 3.1 or 3.2 would most likely be that version).
More information about the Python-3000