[Python-checkins] r64952 - peps/trunk/pep-3101.txt

Guido van Rossum guido at python.org
Tue Jul 15 19:13:19 CEST 2008


On Mon, Jul 14, 2008 at 10:06 AM, Raymond Hettinger <python at rcn.com> wrote:
>>> I would *really* like to see some way to specify a thousands separator.
>>>  Going through the locale module is a pita for this common need.
>>
>> Use the 'n' formatter. Admittedly, you have to have already set the
>> correct locale.
>
> Would it be too much to have a non-locale version so you could specify
> commas, dots, spaces, underscores, squiggles, etc.? Financial users of
> Python despair at the difficulties in formatting with separators.

Beware of too US-centric a POV though. If you hardcode commas as
thousands separators your code will only be correct in the US, and
confuse the heck out of anybody in Europe. So maybe having to go
through the locale module is *good* here for a change. (At least
moderately good. It shouldn't have to be global state, it should be a
settable per thread or per web request context.)

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-checkins mailing list