def validate_arguments(self, args, argcount, arg_types):
    if (argcount is not None):
        if (argcount != len(args)):
            raise InvalidArguments(f'Expected {argcount} arguments, got {len(args)}.')
    for (actual, wanted) in zip(args, arg_types):
        if (wanted is not None):
            if (not isinstance(actual, wanted)):
                raise InvalidArguments('Incorrect argument type.')
def validate_arguments(self, args, argcount, arg_types):
    if (argcount is not None):
        if (argcount != len(args)):
            raise InvalidArguments(f'Expected {argcount} arguments, got {len(args)}.')
    for (actual, wanted) in zip(args, arg_types):
        if (wanted is not None):
            if (not isinstance(actual, wanted)):
                raise InvalidArguments('Incorrect argument type.')