1 2 3 4 5
def filter_by_attr(objs, attr): return filter(lambda x: hasattr(x,attr), objs) filters = [filter_by_attr]