The cmath.isinf() function returns a Boolean value (True or False) indicating if either the real or the imaginary part of the input complex number is infinite.

Syntax:
cmath.isinf(x)
x The value(real or complex) to be checked. If it is a real number, it is converted to a complex number before th operation
Parameters:

The function returns True if the real or imaginary part of x is infinite, otherwise False.

ExampleEdit & Run
import cmath

print(cmath.isinf(100+ 2j))
print(cmath.isinf(10+ -20j))
print(cmath.isinf(cmath.inf))
print(cmath.isinf(complex('inf')))
print(cmath.isinf(complex('-inf')))
print(cmath.isinf(complex(float('inf')+3j)))
Output:
FalseFalseTrueTrueTrueTrue[Finished in 0.010917135048657656s]