Rough draft: Proposed format specifier for a thousands separator

MRAB google at mrabarnett.plus.com
Fri Mar 13 21:04:03 EDT 2009


Raymond Hettinger wrote:
> Todays updates to:  http://www.python.org/dev/peps/pep-0378/
> 
> * Detail issues with the locale module.
> * Summarize commentary to date.
>    -- Opposition to formatting strings in general
>       (preferring a convenience function or PICTURE clause)
>    -- Opposition to any non-locale aware approach
> * Add APOSTROPHE and non-breaking SPACE to the list of separators.
> * Add more links to external references
>   (Babel, Excel, ADA, CommonLisp, COBOL, C-Sharp).
> * Clarify how proposal II is parsed.
> 
I'd just like to make the point that the string methods, eg 
unicode.upper, aren't locale-sensitive, so 'format' shouldn't be either.

The string methods could perhaps retain their current behaviour as the
default and accept a parameter to make them locale-sensitive. The same
could be the case for 'format' so the format string has "." to represent
the decimal point and "," to represent the digit separator, and those
would be the default, but it could accept a flag ("L"?) to make it
locale-sensitive.



More information about the Python-list mailing list