[Python-ideas] String formatting and namedtuple

Christian Tanzer tanzer at swing.co.at
Fri Feb 13 09:58:37 CET 2009


Eric Smith wrote at Thu, 12 Feb 2009 22:49:13 -0500:

> Raymond wrote:
>  >[Terry Reedy]
>  >>  There is certainly some disconnect on the issue.
>  >
>  >FWIW, whenever I done talks on 3.0, it is common to get
>  >an aversive reaction when the new syntax is shown.
>  >I pitch it in a positive light, but you can sense churning stomachs.
>
> [not picking on Raymond here at all, his message was just convenient]
>
> There are a number of comments in this thread that lead me to think not
> everyone is aware that .format is fully supported in 2.6. I just want to
> make sure everyone knows that's the case.
>
> If you want to support 2.6+ and 3.0+, you can certainly use .format.

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.

Counting lines containing `%` in my code base gives 14534 -- a few of
these are numeric (but I'd be surprised if the numeric ones are more
than a couple of hundred).

--
Christian Tanzer                                    http://www.c-tanzer.at/



More information about the Python-ideas mailing list