#NEWLINE# def on_listcomp( self , node ) : #NEWLINE# #INDENT# 'list comprehension' #NEWLINE# out = [ ] #NEWLINE# for tnode in node . generators : #NEWLINE# #INDENT# if ( out . __class__ == ast . comprehension ) : #NEWLINE# #INDENT# for val in self . run ( tnode . iter ) : #NEWLINE# #INDENT# self . node_assign ( tnode . target , val ) #NEWLINE# if ( len ( self . error ) > 0 ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# add = True #NEWLINE# for cond in tnode . ifs : #NEWLINE# #INDENT# add = ( add and self . run ( cond ) ) #NEWLINE# #UNINDENT# if add : #NEWLINE# #INDENT# out . append ( self . run ( node . elt ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return out