Message135536
On Sat, May 7, 2011 at 11:25 AM, Éric Araujo <report@bugs.python.org> wrote:
> .. On one hand, I tend to agree that mixing Hindi/Arab numerals with Bengali does not make sense;
> on the other hand, rejecting it means that the int code does know about Unicode, which you argued
> against.
In order to flag use of mixed scripts in numerals, the code does not
require access to any additional unicode data. Since Unicode 6.0.0,
programmers can rely on the following stability promise:
"""
Characters with the property value Numeric_Type=de (Decimal) only
occur in contiguous ranges of 10 characters, with ascending numeric
values from 0 to 9 (Numeric_Value=0..9).
""" -- http://www.unicode.org/policies/stability_policy.html
Therefore, the validation code can simply check that for all digits in
the number, ord(d) - unicodedata.numeric(d) is the same. |
|
Date |
User |
Action |
Args |
2011-05-08 17:21:05 | belopolsky | set | recipients:
+ belopolsky, lemburg, mark.dickinson, vstinner, eric.smith, ezio.melotti, eric.araujo, skrah |
2011-05-08 17:21:04 | belopolsky | link | issue10581 messages |
2011-05-08 17:21:04 | belopolsky | create | |
|