[Python-Dev] transitioning from % to {} formatting (original) (raw)

Steven Bethard steven.bethard at gmail.com
Fri Oct 2 23:59:25 CEST 2009


On Fri, Oct 2, 2009 at 11:56 AM, Raymond Hettinger <python at rcn.com> wrote:

[Steven Bethard]

Just saying "ok, switch your format strings from % to {}" didn't work in Python 3.0 for various good reasons, and I can't imagine it will work in Python 4.0 unless we have a transition plan. Do the users get any say in this? I imagine that some people are heavily invested in %-formatting. Because there has been limited uptake on {}-formatting (afaict), we still have limited experience with knowing that it is actually better, less error-prone, easier to learn/rember, etc.   Outside a handful of people on this list, I have yet to see anyone adopt it as the preferred syntax.

Sure, I guess this is a possibility too, and it could make the transition process I have to work through for argparse much easier. ;-)

To be clear, are you suggesting that APIs that currently support only %-formatting shouldn't bother supporting {}-formatting at all? Or are you suggesting that they should support both, but support for %-formatting should never go away?

Steve

Where did you get that preposterous hypothesis? Did Steve tell you that? --- The Hiphopopotamus



More information about the Python-Dev mailing list