[Python-ideas] [Python-Dev] Unicode minus sign in numeric conversions

Alexander Belopolsky alexander.belopolsky at gmail.com
Mon Jun 10 00:12:21 CEST 2013


On Sun, Jun 9, 2013 at 4:56 PM, Andrew Barnert <abarnert at yahoo.com> wrote:

> Also, consider how much more complicated parsing gets. Instead of just
> getting the digit value, you also have to get the group that the value
> comes from and make sure you haven't gotten any digits from an incompatible
> group yet. Why write, debug, and maintain that code?


This is not that hard because the latest Unicode standard guarantees that
decimal digits are "encoded in a contiguous range, with ascending order of
Numeric_Value, and with the digit zero as the first code point in the
range." (See 4.6 Numeric Value / Decimal Digits. <
http://www.unicode.org/versions/Unicode6.2.0/ch04.pdf>.)   In other words,
two digits belong to the same group if they have the same ord(x) - int(x)
value.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130609/38e28d57/attachment.html>


More information about the Python-ideas mailing list