Without seeing an example of what f
is before it is passed into your function, it seems like you might be treating it like a sequence object, and trying to index into it:
if f(index) - index < eps:
... might want to be:
if f[index] - index < eps:
This assumes f
is a list, tuple, string, or some other indexable object.
The way you are treating it right now wants to use f
like a callable (function, method, class constructor, ...)
To help with checking your objects, try printing the type of f
:
def fdPt(f, eps):
print f, type(f)