Now that Python is beginning to embrace type annotations, is it worth revisiting the idea of having extended integers and an integer infinity?
I found myself trying to annotate this line:
events_to_do: Union[int, float] = math.inf
where I am only including float in the union to accommodate math.inf.
I'm interested in exploring this concrete proposal:
Add a class to the numeric hierarchy (https://www.python.org/dev/peps/pep-3141/) ExtendedIntegral whereby Real :> ExtendedIntegral :> Integral.
Add a sentinel math.int_inf that obeys all of the same kinds of rules as math.inf does.
Then, I could annotate more simply:
events_to_do: ExtendedIntegral = math.int_inf
With respect to Python, this is discussed somewhat here https://stackoverflow.com/questions/24587994/infinite-integer-in-python/35725065#35725065.
The name "extended integer" is discussed somewhat here https://math.stackexchange.com/questions/1442961/extended-integers. A quick search of papers shows that it is sometimes used in this sense: https://scholar.google.com/scholar?q=%22extended+integer
Best,
Neil