(node, stack=None)
return stack
generate a stack from a portion of the tree
generate a stack from a portion of the tree
generate a stack from a portion of the tree
def _post_order(node, stack=None):
    """
    generate a stack from a portion of the tree
    """

    if stack is None:
        stack = list()

    if type(node) is list:
        if len(node) > 3:
            _post_order(node[3], stack)
        if len(node) > 4:
            _post_order(node[4], stack)
        stack.append(node[0])
    else:
        stack.append(node)
    return stack
def _post_order ( node , stack = None ) : if stack is None : stack = list ( ) if type ( node ) is list : if len ( node ) > 3 : _post_order ( node [ 3 ] , stack ) if len ( node ) > 4 : _post_order ( node [ 4 ] , stack ) stack . append ( node [ 0 ] ) else : stack . append ( node ) return stack