[docs] [issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

Serhiy Storchaka report at bugs.python.org
Fri Mar 4 16:02:07 EST 2016


Serhiy Storchaka added the comment:

Yes. For details you need to read The Unicode Standard.

And every decimal character is accepted by the int() constructor, but non-decimal digits are not.

>>> for d in decimals: x = int(d)
... 
>>> for d in set(digits) - set(decimals):
...     try:
...         int(d)
...     except ValueError:
...         pass
...     else:
...         raise AssertionError
...

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26483>
_______________________________________


More information about the docs mailing list