Rough draft: Proposed format specifier for a thousands separator

pruebauno at latinmail.com pruebauno at latinmail.com
Fri Mar 13 11:03:49 EDT 2009


On Mar 13, 7:06 am, Tim Rowe <digi... at gmail.com> wrote:
> 2009/3/12 Raymond Hettinger <pyt... at rcn.com>:
>
> > If anyone here is interested, here is a proposal I posted on the
> > python-ideas list.
>
> > The idea is to make numbering formatting a little easier with the new
> > format() builtin
> > in Py2.6 and Py3.0:  http://docs.python.org/library/string.html#formatspec
>
> As far as I can see you're proposing an amendment to *encourage*
> writing code that is not locale aware, with the amendment itself being
> locale specific, which surely has to be a regressive move in the 21st
> century. Frankly, I'd sooner see it made /harder/ to write code that
> is not locale aware (warnings, like FxCop gives on .net code?) tnan
> /easier/. Perhaps that's because I'm British, not American and I'm
> sick of having date fields get the date wrong because the programmer
> thinks the USA is the world. It makes me sympathetic to the problems
> caused to others by programmers who think the English-speaking world
> is the world.
>
> By the way, to others who think that 123,456.7 and 123.456,7 are the
> only conventions in common use in the West, no they're not. 123 456.7
> is in common use in engineering, at least in Europe, precisely to
> reduce (though not eliminate) problems caused by dot and comma
> confusion..
>
> --
> Tim Rowe

I lived in three different countries and in school used blank for
thousand separator to avoid confusion with the multiply operator. I
think this proposal is more for debugging big numbers and meant mostly
for programmers' eyes. We are already using the dot instead of comma
decimal separator in our programming languages that one more
Americanism won't kill us.

I am leaning towards proposal 1 now just to avoid the thousand
variations that will be requested because of this, making the
implementation unnecessarily complex. I can always use the 3
replacement hack (conveniently documented in the pep).

+1 for Nick's proposal



More information about the Python-list mailing list