The easiest way to get this behaviour is to use numpy.float64 instead of Python default float type:
>>> import numpy
>>> numpy.float64(1.0) / 0.0
inf
Of course this requires NumPy. You can use numpy.seterr() to fine-tune the error handling.