This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tfish2
Recipients tfish2
Date 2022-03-25.17:28:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
>>> help(math.isfinite)
isfinite(x, /)
    Return True if x is neither an infinity nor a NaN, and False otherwise.

So, one would expect the following expression to return `True` or `False`. We instead observe:

>>> math.isfinite(10**1000)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: int too large to convert to float

(There likewise is a corresponding issue with other, similar, functions).

This especially hurts since PEP-484 states that having a Sequence[float] `xs` does not allow us to infer that `all(issubclass(type(x), float) for x in xs)` actually holds - since a PEP-484 "float" actually does also include "int" (and still, issubclass(int, float) == False).

Now, strictly speaking, `help(math)` states that

    This module provides access to the mathematical functions
    defined by the C standard.

...but according to "man 3 isfinite", the math.h "isfinite" is a macro and not a function - and the man page does not show type information for that reason.
Date User Action Args
2022-03-25 17:28:43tfish2setrecipients: + tfish2
2022-03-25 17:28:43tfish2setmessageid: <>
2022-03-25 17:28:43tfish2linkissue47121 messages
2022-03-25 17:28:43tfish2create