ExampleEdit & Run
#import the cmath module
import cmath

print(cmath.inf)
copy
Output:
inf [Finished in 0.010695578064769506s]

The cmath module defines some useful constants, among them, is the inf constant. The inf constant  is a floating point value representing the mathematical notion of infinity.

In mathematics, infinity is a concept describing something that is limitless or endless. It is usually referred to as a number greater than any real or natural number.

Syntax:
cmath.inf
copy

The value returned is equivalent to float('inf').

ExampleEdit & Run
import cmath

print(cmath.inf == float('inf'))
copy
Output:
True [Finished in 0.010319643653929234s]
ExampleEdit & Run
import cmath

print(sorted([1, 100, 50, 1000, 230, cmath.inf]))
copy
Output:
[1, 50, 100, 230, 1000, inf] [Finished in 0.009663099888712168s]