#NEWLINE# def findtype( self , variable ) : #NEWLINE# #INDENT# ':see Expression.findtype()' #NEWLINE# assert isinstance ( variable , Variable ) , ( '%s is not a Variable' % variable ) #NEWLINE# if self . is_atom ( ) : #NEWLINE# #INDENT# ( function , args ) = self . uncurry ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# function = self . function #NEWLINE# args = [ self . argument ] #NEWLINE# #UNINDENT# found = [ arg . findtype ( variable ) for arg in ( [ u ] + args ) ] #NEWLINE# unique = [ ] #NEWLINE# for f in found : #NEWLINE# #INDENT# if ( f != ANY_TYPE ) : #NEWLINE# #INDENT# if unique : #NEWLINE# #INDENT# for u in unique : #NEWLINE# #INDENT# if f . matches ( u ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# unique . append ( f ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( len ( unique ) == 1 ) : #NEWLINE# #INDENT# return list ( unique ) [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ANY_TYPE