[issue6632] Include more fullwidth chars in the decimal codec

Marc-Andre Lemburg report at bugs.python.org
Mon Aug 3 20:43:50 CEST 2009


Marc-Andre Lemburg <mal at egenix.com> added the comment:

Ezio Melotti wrote:
> 
> New submission from Ezio Melotti <ezio.melotti at gmail.com>:
> 
> The decimal codec only handles characters in the Nd (Number, decimal)
> Unicode category and whitespaces [a]. It is used by int(), float(),
> complex() and indirectly by Decimal(), Fraction() and possibly others.
> This works well only for plain digits (e.g. int(u'123')) but it
> doesn't work for all the other characters used to represent numbers, like:
> [...]

In general, Python has always stuck to the Unicode standard
for these things (as well as others like casing, etc.).

If the Unicode standard adopts a scheme for dealing with these
issues, we should include support for it.

Implementing something based on non-standards now and breaking
that support later on in order to implement the true standards
is not such a good idea.

There is work underway to define a standard for locale specific
formatting of numbers, dates, etc.:

    http://cldr.unicode.org/

Here's the TR with the data format specification:

    http://www.unicode.org/reports/tr35/tr35-12.html

I'm sure that the information gathered in that project will
sooner or later be folded back into the standard Unicode character
database. Once that's done we can then use that information to
e.g. determine the characters that make up a sign, decimal
point, etc.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6632>
_______________________________________


More information about the Python-bugs-list mailing list