[Python-Dev] Re: string formatting and i18n
antoine at pitrou.net
Mon Sep 5 21:20:27 CEST 2005
> Yes. If you think I was arguing the opposite, then I failed to
> communicate clearly and I apologize.
Actually, I didn't interpret your message like that, but as I had
already seen that proposal (to suppress string formatting), I thought it
would be the right time to react ;)
> For instance, take your I18N example. Not all languages have the
> same word order, as you've observed. When there's more than one
> parameter, Python's %-interpolation isn't enough in general;
> you'd need something that can reorder the parameters. I don't
> know whether this is worth complicating string formatting for,
> but it's not obvious that it isn't.
Well, I totally agree. I think it could be nice to both:
- introduce positional formatting : "%1", "%2"...
- make type specification optional, since Python can figure out the type
by itself and use the right method; you would only specify the type when
you want to have a different formatting (for example, for floats, you
could use "%g2" instead of "%2" which would be equivalent to "%f2")
« On dit que pétrir c'est modeler,
Moi je dis que péter c'est démolir. »
More information about the Python-Dev