[Python-ideas] String formatting and namedtuple

Guido van Rossum guido at python.org
Fri Feb 13 18:56:55 CET 2009

On Fri, Feb 13, 2009 at 12:58 AM, Christian Tanzer <tanzer at swing.co.at> wrote:
> I think the main problem is the huge amount of existing code that uses
> `%` for formatting. As long as there is no easy way to migrate that
> code to `.format`, moves to deprecate `%`-formatting are bound to
> cause friction.

Yes, that was our concern too when we decided to keep % without
deprecation in 3.0.

My guess is that *most* of these use string literals, and we *can*
write a 2to3 fixer for those.

It is the cases where the format is being passed in as an argument or
precomputed somehow where 2to3 falls down. It would be useful to have
an idea how frequently that happens.

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-ideas mailing list