(node)
return (isinstance(node, Node)
            and len(node.children) > 1
            and isinstance(node.children[0], Leaf)
            and isinstance(node.children[-1], Leaf)
            and node.children[0].value == "["
            and node.children[-1].value == "]")
Does the node represent a list literal?
Does the node represent a list literal?
Does the node represent a list literal?
def is_list(node):
    """Does the node represent a list literal?"""
    return (isinstance(node, Node)
            and len(node.children) > 1
            and isinstance(node.children[0], Leaf)
            and isinstance(node.children[-1], Leaf)
            and node.children[0].value == "["
            and node.children[-1].value == "]")
def is_list ( node ) : return ( isinstance ( node , Node ) and len ( node . children ) > 1 and isinstance ( node . children [ 0 ] , Leaf ) and isinstance ( node . children [ - 1 ] , Leaf ) and node . children [ 0 ] . value == "[" and node . children [ - 1 ] . value == "]" )