[issue38474] digit check logic can be replaced by Py_ISDIGIT on prepare_s

Serhiy Storchaka report at bugs.python.org
Tue Oct 15 11:57:47 EDT 2019


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

It was added as a replacement of locale aware isdigit(). It was initially used only for implementing bytes.isdigit() and in PyOS_ascii_strtod().

isdigit() is not used in Modules/_struct.c, so there is nothing to replace with Py_ISDIGIT(). Currently hardcoded '0' and '9' are used in more places than Py_ISDIGIT(). Rewriting all this code just because we have Py_ISDIGIT() is a code churn.

----------

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


More information about the Python-bugs-list mailing list