Using numpy, I have this definition of a function:
def powellBadlyScaled(X): f1 = 10**4 * X[0] * X[1] - 1 f2 = numpy.exp(-numpy.float(X[0])) + numpy
You can use numpy.seterr to control how numpy behaves in this circumstance: http://docs.scipy.org/doc/numpy/reference/generated/numpy.seterr.html
numpy.seterr
You can also use the warnings module to control how warnings are or are not presented: http://docs.python.org/library/warnings.html