def is_SYMBOL ( token , * symbols ) : from symbols . symbol_ import Symbol assert all ( isinstance ( x , Symbol ) for x in symbols ) for sym in symbols : if sym . token != token : return False return True
testing the symbol set with nested brackets in python
Returns True if ALL of the given argument are AST nodes of the given token ( e . g . BINARY )
def is_SYMBOL(token, *symbols):
    """ Returns True if ALL of the given argument are AST nodes
    of the given token (e.g. 'BINARY')
    """
    from symbols.symbol_ import Symbol
    assert all(isinstance(x, Symbol) for x in symbols)
    for sym in symbols:
        if sym.token != token:
            return False

    return True