class X(object):

    def __init__(self, pred):
        self.pred = pred

def __eq__(self, other):
    return self.pred(other)
l = [8, 10, 4, 5, 7]

def is_odd(x):
    return x % 2 != 0
l.index(X(is_odd))
Python: return the index of the first element of a list which makes a passed function true