fns = [] for i in range(2): fns.append(lambda: isinstance(x, (int, str)))