def setoperator(op):
    """
    Returns a function which performs set operations
    """
    if op == '|':
        return lambda x, y: x | y
    if op == '&':
        return lambda x, y: x & y
    if op == '-':
        return lambda x, y: x - y
    raise Exception('operator %s not found' % op)
