def _after(node):
 try:
  pos = node.treeposition()
  tree = node.root()
 except AttributeError:
  return []
 return [tree[x] for x in tree.treepositions() if (x[:len(pos)] > pos[:len(x)])]

def _after ( node ) : try : pos = node . treeposition ( ) tree = node . root ( ) except AttributeError : return [ ] return [ tree [ x ] for x in tree . treepositions ( ) if ( x [ : len ( pos ) ] > pos [ : len ( x ) ] ) ]
returns the set of all nodes that are after the given node .