def is_in(a_list):
    """Returns a *function* that checks if its argument is in list.
    Avoids recalculation of list at every comparison."""
    def check(arg): return arg in a_list
    return check