Message370424
There is PyNumber_Check(). It is not direct analog of isinstance(obj, numbers.Number), it checks that the object can be explicitly converted to the real number (int or float). UUID and IPv4Address pass this check.
As a narrow check we can use isinstance(obj, (str, int, float)). It does not accept Fraction, Decimal and numpy numbers, but it is what such modules like json or plistlib accept. |
|
Date |
User |
Action |
Args |
2020-05-31 11:23:51 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, eric.smith, corona10 |
2020-05-31 11:23:51 | serhiy.storchaka | set | messageid: <1590924231.42.0.852280265585.issue40825@roundup.psfhosted.org> |
2020-05-31 11:23:51 | serhiy.storchaka | link | issue40825 messages |
2020-05-31 11:23:51 | serhiy.storchaka | create | |
|