def expression_closure(field, operator, value):
    """ Creates and returns a function expression.
        Operator supports: < <= > >= !=

        Example:
            >>> class Obj:
            >>>     number = 5
            >>> obj = Obj()
            >>> func_expression = expression_closure('number', '<', 10)
            >>> func_expression(obj)
            True
            >>> obj.number = 11
            >>> func_expression(obj)
            False
    """
    if operator == '>':
        return lambda obj: getattr(obj, field) > value
    elif operator == '<':
        return lambda obj: getattr(obj, field) < value
    elif operator == '>=':
        return lambda obj: getattr(obj, field) >= value
    elif operator == '<=':
        return lambda obj: getattr(obj, field) <= value
    elif operator == '!=':
        return lambda obj: getattr(obj, field) != value
    else:
        raise ValueError("Unknown operator %s" % operator)