[Python-ideas] Rough draft: Proposed format specifier for a thousands separator (discussion moved from python-dev)
Steven D'Aprano
steve at pearwood.info
Thu Mar 19 10:27:27 CET 2009
On Thu, 19 Mar 2009 08:12:20 pm spir wrote:
> Le Thu, 19 Mar 2009 08:33:43 +1000,
>
> Nick Coghlan <ncoghlan at gmail.com> s'exprima ainsi:
> > B. All I can suggest is to try to think of the "commas as
> > separators in format()" situation as being in the same vein as that
> > whole "let use English keywords where possible" idea :)
>
> This is a wrong rationale. The readers of python keywords is the
> community of pythonistas (*); while the readers of documents produced
> by apps written in python can be any kind of people. "1,234,567.89"
> is more or less illegible for people not used to english conventions.
> Specifying the separator(s) is definitely a bad idea imo. I have not
> understood the proposal to be intended only for debug, but for all
> kinds of quick and/or unpublished developpment. Even in the first
> case, having numbers output in the format your eyes are used to is a
> nice & worthful help. Imagine you -- and all programmers, and
> millions of users -- would have to cope with numbers like
> "1.234.567,89" all the time only because someone decided (for any
> reason) that separators must be fixed, and this format is the obvious
> one.
It would be sub-optimal but hardly "more or less illegible".
But then I'm not American and therefore I'm already used to people
misspelling colour as "color", centre as "center", and biscuit
as "cookie" *wink*
Nevertheless, I agree that for output, we shouldn't hard-code the
decimal and thousands separator as "." and "," respectively -- although
as an English-speaker, I'd be happy for those choices to be the
default.
But surely with Raymond and Mark's idea about passing a dict derived
from locale, this is no longer an issue? Are hard-coded separators
still on the table?
--
Steven D'Aprano
More information about the Python-ideas
mailing list