Alexander Belopolsky <belopol...@users.sourceforge.net> added the comment:

On Sat, May 7, 2011 at 11:25 AM, Éric Araujo <rep...@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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10581>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to