def objectify_predicate(selector_func):
 return type(selector_func.__name__, (Predicate,), {'__doc__': selector_func.__doc__, '__call__': (lambda self, *a, **kw: selector_func(*a, **kw))})

def objectify_predicate ( selector_func ) : return type ( selector_func . __name__ , ( Predicate , ) , { '__doc__' : selector_func . __doc__ , '__call__' : ( lambda self , * a , ** kw : selector_func ( * a , ** kw ) ) } )
most of the time .