Message 83571 - Python tracker (original) (raw)

Only Formatter.format_field() is particularly hard to override at the moment (for the same reason that format() methods are tricky to write). That said, creating a locale aware version of string formatting based on string.Formatter is such an obvious idea that I would actually be surprised if someone hasn't done it by now (they may not have published it anywhere, but I expect someone has implemented it for their own use).

That said, I think it's OK for string.Formatter to lag the actual str.format implementation when it comes to features like this. I see it as similar to the formatting mini-language parser problem: the primary goal is to have a good implementation and syntax for str.format, while providing the tools to allow people to create alternative formatters with similar power is secondary.