2 Jul
2019
2 Jul
'19
1:09 p.m.
An intuitive way to annotate that variable in Python 3.8 would be: ``` events_to_do: Union[int, Literal[math.inf]] = math.inf ``` That has the advantage of matching the way you would write it now, without changing the core language. It unfortunately doesn't work, because PEP 586 provisionally disallows float literals, but it may become supported in the future. One other possible advantage of doing it this way is that you don't have to include negative infinity (-math.inf). There are applications where you only need positive infinity, or only need negative infinity.