As above:
```
start, end = ...
if start is not S.NegativeInfinity:
   ...
if end is not S.Infinity:
   ...
```