def check_constraint(fn, constraint): c_key = tuple( takewhile(lambda x: x is not None, constraint_key(constraint))) def inner(version): return fn(constraint_key(version)[:len(c_key)], c_key) return inner
def inner(version): return fn( constraint_key(version)[:len(c_key)], c_key )