pylint/checkers/classes.py
def _has_different_parameters_default_value(original, overridden):
    """
    Check if original and overridden methods arguments have different default values

    Return True if one of the overridden arguments has a default
    value different from the default value of the original argument
    If one of the method doesn't have argument (.args is None)
    return False
    """
    if original.args is None or overridden.args is None:
        return False

    all_args = chain(original.args, original.kwonlyargs)
    original_param_names = [param.name for param in all_args]
    default_missing = object()
    for param_name in original_param_names:
        try:
            original_default = original.default_value(param_name)
        except astroid.exceptions.NoDefault:
            original_default = default_missing
        try:
            overridden_default = overridden.default_value(param_name)
        except astroid.exceptions.NoDefault:
            overridden_default = default_missing

        default_list = [
            arg == default_missing for arg in (original_default, overridden_default)
        ]
        if any(default_list) and not all(default_list):
            # Only one arg has no default value
            return True

        astroid_type_compared_attr = {
            astroid.Const: "value",
            astroid.ClassDef: "name",
            astroid.Tuple: "elts",
            astroid.List: "elts",
        }
        handled_types = tuple(
            astroid_type for astroid_type in astroid_type_compared_attr
        )
        original_type = _get_node_type(original_default, handled_types)
        if original_type:
            #  We handle only astroid types that are inside the dict astroid_type_compared_attr
            if not isinstance(overridden_default, original_type):
                #  Two args with same name but different types
                return True
            if not _check_arg_equality(
                original_default,
                overridden_default,
                astroid_type_compared_attr[original_type],
            ):
                # Two args with same type but different values
                return True
    return False
def _has_different_parameters_default_value(original, overridden):
    if original.args is None or overridden.args is None:
        return False

    all_args = chain(original.args, original.kwonlyargs)
    original_param_names = [param.name for param in all_args]
    default_missing = object()
    for param_name in original_param_names:
        try:
            original_default = original.default_value(param_name)
        except astroid.exceptions.NoDefault:
            original_default = default_missing
        try:
            overridden_default = overridden.default_value(param_name)
        except astroid.exceptions.NoDefault:
            overridden_default = default_missing

        default_list = [
            arg == default_missing for arg in (original_default, overridden_default)
        ]
        if any(default_list) and not all(default_list):
            # Only one arg has no default value
            return True

        astroid_type_compared_attr = {
            astroid.Const: "value",
            astroid.ClassDef: "name",
            astroid.Tuple: "elts",
            astroid.List: "elts",
        }
        handled_types = tuple(
            astroid_type for astroid_type in astroid_type_compared_attr
        )
        original_type = _get_node_type(original_default, handled_types)
        if original_type:
            #  We handle only astroid types that are inside the dict astroid_type_compared_attr
            if not isinstance(overridden_default, original_type):
                #  Two args with same name but different types
                return True
            if not _check_arg_equality(
                original_default,
                overridden_default,
                astroid_type_compared_attr[original_type],
            ):
                # Two args with same type but different values
                return True
    return False
def _has_different_parameters_default_value ( original , overridden ) : if original . args is None or overridden . args is None : return False all_args = chain ( original . args , original . kwonlyargs ) original_param_names = [ param . name for param in all_args ] default_missing = object ( ) for param_name in original_param_names : try : original_default = original . default_value ( param_name ) except astroid . exceptions . NoDefault : original_default = default_missing try : overridden_default = overridden . default_value ( param_name ) except astroid . exceptions . NoDefault : overridden_default = default_missing default_list = [ arg == default_missing for arg in ( original_default , overridden_default ) ] if any ( default_list ) and not all ( default_list ) : # Only one arg has no default value return True astroid_type_compared_attr = { astroid . Const : "value" , astroid . ClassDef : "name" , astroid . Tuple : "elts" , astroid . List : "elts" , } handled_types = tuple ( astroid_type for astroid_type in astroid_type_compared_attr ) original_type = _get_node_type ( original_default , handled_types ) if original_type : #  We handle only astroid types that are inside the dict astroid_type_compared_attr if not isinstance ( overridden_default , original_type ) : #  Two args with same name but different types return True if not _check_arg_equality ( original_default , overridden_default , astroid_type_compared_attr [ original_type ] , ) : # Two args with same type but different values return True return False
Check if original and overridden methods arguments have different default values

    Return True if one of the overridden arguments has a default
    value different from the default value of the original argument
    If one of the method doesn't have argument (.args is None)
    return False
Check if original and overridden methods arguments have different default values