#NEWLINE# def _rate_arguments( self , actualargs , formalargs ) : #NEWLINE# #INDENT# '\n        Rate the actual arguments for compatibility against the formal\n        arguments.  A Rating instance is returned, or None if incompatible.\n        ' #NEWLINE# if ( len ( actualargs ) != len ( formalargs ) ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# rate = Rating ( ) #NEWLINE# for ( actual , formal ) in zip ( actualargs , formalargs ) : #NEWLINE# #INDENT# conv = self . can_convert ( actual , formal ) #NEWLINE# if ( conv is None ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# if ( conv == Conversion . promote ) : #NEWLINE# #INDENT# rate . promote += 1 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( conv == Conversion . safe ) : #NEWLINE# #INDENT# rate . safe_convert += 1 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( conv == Conversion . unsafe ) : #NEWLINE# #INDENT# rate . unsafe_convert += 1 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( conv == Conversion . exact ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise Exception ( 'unreachable' , conv ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return actual