#NEWLINE# def visit_Assign( self , node ) : #NEWLINE# #INDENT# '\n        Visits Assign nodes in a tree.  Adds relevant data about them to symbols.\n\n        :param node: The current node.\n\n        :type node: ast.Assign\n\n        .. todo::\n            Add value and type metadata to symbols.\n        ' #NEWLINE# pos = self . block_position ( node ) #NEWLINE# for t in node . targets : #NEWLINE# #INDENT# self . visit ( name ) #NEWLINE# #UNINDENT# for name in self . cache : #NEWLINE# #INDENT# if ( not self . symbols [ 'vars' ] . has_key ( name ) ) : #NEWLINE# #INDENT# self . symbols [ 'vars' ] [ name ] = { #NEWLINE# #INDENT# 'assignments' : [ ] , #NEWLINE# 'uses' : [ ] , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# self . symbols [ 'vars' ] [ name ] [ 'assignments' ] . append ( pos ) #NEWLINE# #UNINDENT# self . clear_cache ( ) #NEWLINE# self . visit ( node . value ) #NEWLINE# for name in self . cache : #NEWLINE# #INDENT# if ( not self . symbols [ 'vars' ] . has_key ( name ) ) : #NEWLINE# #INDENT# self . symbols [ 'vars' ] [ name ] = { #NEWLINE# #INDENT# 'assignments' : [ ] , #NEWLINE# 'uses' : [ ] , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# self . symbols [ 'vars' ] [ name ] [ 'uses' ] . append ( pos ) #NEWLINE# #UNINDENT# self . clear_cache ( )