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

Terry Reedy tjreedy at udel.edu
Sat Mar 14 21:08:56 CET 2009


Raymond Hettinger wrote:
> Todays updates to:  http://www.python.org/dev/peps/pep-0378/
> 
> * Summarize commentary to date.
> * Add APOSTROPHE and non-breaking SPACE to the list of separators.
> * Add more links to external references.
> * Detail issues with the locale module.
> * Clarify how proposal II is parsed.

+1 for proposal 2

Comment on locale.  It was designed, perhaps 30 years ago, for 
*national* programming (hence the global locale setting).  The doc 
should really describe it as for 'nationalization' rather than for 
'internatioalization'.

For *global* (international) programming, all the formatting functions 
should either take a locale dict or be instance methods of a Locale 
class whose instances are individual locales.  With this PEP 
implemented, we could potentially locale with a platform- and 
implementation-language-independent countrybase and country module with 
Country class using the expanded str.format strings.

The only thing not directly handled, as far as I can see, is groupings 
other than by threes, which would have to be handled by other means.

Terry Jan Reedy




More information about the Python-ideas mailing list