[Python-ideas] Rough draft: Proposed format specifier for a thousands separator (discussion moved from python-dev)

Eric Smith eric at trueblade.com
Fri Mar 13 01:22:01 CET 2009


Raymond Hettinger wrote:
> 
> [Eric Smith]
>> Decimal shouldn't really have to completely reimplement locale-based 
>> formatting, especially when it already exists in the core. I just want 
>> to expose it.
> 
> I see.  Sounds like you're looking for the parser to have some hooks
> so that people writing new __format__ methods don't have to start
> from scratch.

Not necessarily hooks, but some support routines. I think the standard 
format specifier parser should be exposed, and also the locale-based 
formatter should be exposed. These are both unrelated to PEP 378, but 
they could be used to implement it. They'd be especially useful for 
non-builtin types like Decimal.

> Makes sense.  Hopefully, we can get this thread back on track for
> evaluating the proposal for a minor buildout to the existing mini-language.

Right. Apologies for hijacking it, and especially for not making it 
clear that I was veering off subject.

Eric.




More information about the Python-ideas mailing list