float('inf')
is guaranteed to test as larger than any number, including integers. This is not platform specific.
From the floatobject.c
source code:
else if (!Py_IS_FINITE(i)) {
if (PyInt_Check(w) || PyLong_Check(w))
/* If i is an infinity, its magnitude exceeds any
* finite integer, so it doesn't matter which int we
* compare i with. If i is a NaN, similarly.
*/
j = 0.0;
Python integers themselves are only bounded by memory, so using 10 ** 3000
is not going to be big enough, probably.
float('inf')
is always available; Python will handle underlying platform specifics for you to make this so.