#NEWLINE# def pre_order( self ) : #NEWLINE# #INDENT# 'Return a pre-order iterator for the tree.' #NEWLINE# ( yield self ) #NEWLINE# for child in node . children : #NEWLINE# #INDENT# for node in child . pre_order ( ) : #NEWLINE# #INDENT# ( yield node )