diff --git a/pep-0378.txt b/pep-0378.txt index 26cf84590..c89ea1907 100644 --- a/pep-0378.txt +++ b/pep-0378.txt @@ -35,7 +35,8 @@ in detail. .. _`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 @@ Research so far 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 @@ Examples:: 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 @@ Commentary 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 =========