Message336461
> `int` and `float` required general category Nd, which corresponds to `str.isdigit`.
Sorry, did you mean str.isdecimal? since there could be a subset where isdigit is True and isdecimal returns False.
>>> '\u00B2'.isdecimal()
False
>>> '\u00B2'.isdigit()
True
>>> import unicodedata
>>> unicodedata.category('\u00B2')
'No'
>>> int('\u00B2')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 10: '²'
Is this worth an FAQ or an addition to the existing note on int that specifies characters should belong to 'Nd' category to add a note that str.isdecimal should return True |
|
Date |
User |
Action |
Args |
2019-02-24 11:07:41 | xtreak | set | recipients:
+ xtreak, mark.dickinson, StyXman, steven.daprano |
2019-02-24 11:07:41 | xtreak | set | messageid: <1551006461.71.0.390771447441.issue36100@roundup.psfhosted.org> |
2019-02-24 11:07:41 | xtreak | link | issue36100 messages |
2019-02-24 11:07:41 | xtreak | create | |
|