[Python-checkins] r70414 - peps/trunk/pep-0378.txt
raymond.hettinger
python-checkins at python.org
Mon Mar 16 08:24:12 CET 2009
Author: raymond.hettinger
Date: Mon Mar 16 08:24:12 2009
New Revision: 70414
Log:
Clarify that the PEP intent is not to serve as an
internationalization tool or to accommodate every
possible convention. It intends to provide a
generally useful tool for improving readability in
many contexts.
Also, clarify the groupings are for the integer part
of a number. Digits to the right of the decimal point
are unchanged.
Modified:
peps/trunk/pep-0378.txt
Modified: peps/trunk/pep-0378.txt
==============================================================================
--- peps/trunk/pep-0378.txt (original)
+++ peps/trunk/pep-0378.txt Mon Mar 16 08:24:12 2009
@@ -35,7 +35,8 @@
.. _`many other challenges`: http://docs.python.org/library/locale.html#background-details-hints-tips-and-caveats
-It is not the goal to replace the locale module or to
+It is not the goal to replace the locale module, to perform
+internationalization takes, or
accommodate every possible convention. Such tasks are better
suited to robust tools like `Babel`_ . Instead, our goal is to
make a common, everyday task easier for many users.
@@ -59,12 +60,6 @@
Scanning the web, I've found that thousands separators are
usually one of COMMA, DOT, SPACE, APOSTROPHE or UNDERSCORE.
-James Knight observed that Indian/Pakistani numbering systems
-group by hundreds. Ben Finney noted that Chinese group by
-ten-thousands. Eric Smith pointed-out that these are already
-handled by the "n" specifier in the locale module (albeit only
-for integers).
-
Visual Basic and its brethren (like `MS Excel`_) use a completely
different style and have ultra-flexible custom format
specifiers like::
@@ -157,8 +152,11 @@
format(1234, "8,d") --> ' 1,234'
format(1234, "8_d") --> ' 1_234'
-This proposal meets mosts needs , but it comes at the expense
-of being a little more complicated to learn and remember.
+This proposal meets mosts needs, but it comes at the expense
+of taking a bit more effort to parse. Not every possible
+convention is covered, but at least one of the options (spaces
+or underscores) should be readable, understandable, and useful
+to folks from many diverse backgrounds.
As shown in the examples, the *width* argument means the total
length including the thousands separators and decimal separators.
@@ -220,6 +218,21 @@
is to set the convention once and have it apply everywhere (others
commented that locale already provides a way to do this).
+* There are some precedents for grouping digits in the fractional
+ part of a floating point number, but this PEP does not venture into
+ that territory. Only digits to the left of the decimal point are
+ grouped. This does not preclude future extensions; it just focuses
+ on a single, generally useful extension to the formatting language.
+
+* James Knight observed that Indian/Pakistani numbering systems
+ group by hundreds. Ben Finney noted that Chinese group by
+ ten-thousands. Eric Smith pointed-out that these are already
+ handled by the "n" specifier in the locale module (albeit only
+ for integers). This PEP does not attempt to support all of those
+ possibilities. It focuees on a single, relatively common grouping
+ convention that offers a quick way to improve readability in many
+ (though not all) contexts.
+
Copyright
=========
More information about the Python-checkins
mailing list