[issue17331] Fix str methods for detecting digits with unicode

2013-03-01 Thread Mathieu Pasquet
New submission from Mathieu Pasquet: In py3k, str.isalnum(), str.isdigit(), and str.isdecimal() are broken because they take into account various unicode numbers. A common case is doing something like that: num = -1 while num == -1: num_in = input('Enter a number ') if

[issue17331] Fix str methods for detecting digits with unicode

2013-03-01 Thread R. David Murray
R. David Murray added the comment: I think this is working as designed, and can't be changed (at least not easily) because of backward compatibility even if there are bits of the design that are deemed buggy. The issue, I believe, is what is considered a number by the Unicode consortium.

[issue17331] Fix str methods for detecting digits with unicode

2013-03-01 Thread Florent Xicluna
Florent Xicluna added the comment: Actually, the character is SUPERSCRIPT ONE, in the category No (Number other). http://www.fileformat.info/info/unicode/char/b9/index.htm This is not a valid category for the identifiers, only Nd Number decimal is accepted. The issue is probably in

[issue17331] Fix str methods for detecting digits with unicode

2013-03-01 Thread Mathieu Pasquet
Mathieu Pasquet added the comment: I understand the reasoning behind the feature, and the will to be unicode-compliant, but I think this might still break a lot of code (though it may never be detected). I understand that isdecimal() is the safe way, because anything that is a decimal (Nd)