#NEWLINE# def _crawl( expr , func , * args , **kwargs ) : #NEWLINE# #INDENT# 'Crawl the expression tree, and apply func to every node.' #NEWLINE# val = func ( expr , * args , ** kwargs ) #NEWLINE# if ( val is not None ) : #NEWLINE# #INDENT# return val #NEWLINE# #UNINDENT# new_args = ( _crawl ( arg , func , * args , ** kwargs ) for arg in expr . args ) #NEWLINE# return expr . func ( * new_args )