[issue36100] int() and float() should accept any isnumeric() digit

Mark Dickinson report at bugs.python.org
Sun Feb 24 05:57:40 EST 2019


Mark Dickinson <dickinsm at gmail.com> added the comment:

> So to check if a string can be converted to integer with help of int() I should be using str.isdecimal() instead of str.isnumeric() ?

Yes, I think that's correct. The characters matched by `str.isdecimal` are a subset of those matched by `str.isdigit`, which in turn are a subset of those matched by `str.isnumeric`. `int` and `float` required general category Nd, which corresponds to `str.isdigit`.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36100>
_______________________________________


More information about the Python-bugs-list mailing list