New submission from Steven D'Aprano: Currently, math.isnan(n) and math.isinf(n) for n an int may raise OverflowError if n is too big to convert to a float, e.g.:
py> math.isnan(10**10000) Traceback (most recent call last): File "<stdin>", line 1, in <module> OverflowError: int too large to convert to float But this conversion is unnecessary. int does not support either INF or NAN, so there is no need to convert the value to float first. If the argument is an int, the result must be False. The same applies to Fraction. ---------- messages: 274568 nosy: steven.daprano priority: normal severity: normal status: open title: math.isnan(int) and math.isinf(int) should not raise OverflowError _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27975> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com