'Rate the actual arguments for compatibility against the formal
arguments.  A Rating instance is returned, or None if incompatible.'

def _rate_arguments(self, actualargs, formalargs, unsafe_casting=True):

    if (len(actualargs) != len(formalargs)):
        return None
    rate = Rating()
    for (actual, formal) in zip(actualargs, formalargs):
        conv = self.can_convert(actual, formal)
        if (conv is None):
            return None
        elif ((not unsafe_casting) and (conv >= Conversion.unsafe)):
            return None
        if (conv == Conversion.promote):
            rate.promote += 1
        elif (conv == Conversion.safe):
            rate.safe_convert += 1
        elif (conv == Conversion.unsafe):
            rate.unsafe_convert += 1
        elif (conv == Conversion.exact):
            pass
        else:
            raise Exception('unreachable', conv)
    return rate
