pylint/checkers/base.py
def _check_redefinition(self, redeftype, node):
        """check for redefinition of a function / method / class name"""
        parent_frame = node.parent.frame()
        defined_self = parent_frame[node.name]
        if defined_self is not node and not astroid.are_exclusive(node, defined_self):

            # Additional checks for methods which are not considered
            # redefined, since they are already part of the base API.
            if (
                isinstance(parent_frame, astroid.ClassDef)
                and node.name in REDEFINABLE_METHODS
            ):
                return

            dummy_variables_rgx = lint_utils.get_global_option(
                self, "dummy-variables-rgx", default=None
            )
            if dummy_variables_rgx and dummy_variables_rgx.match(node.name):
                return
            self.add_message(
                "function-redefined",
                node=node,
                args=(redeftype, defined_self.fromlineno),
            )
def _check_redefinition(self, redeftype, node):
        """check for redefinition of a function / method / class name"""
        parent_frame = node.parent.frame()
        defined_self = parent_frame[node.name]
        if defined_self is not node and not astroid.are_exclusive(node, defined_self):

            # Additional checks for methods which are not considered
            # redefined, since they are already part of the base API.
            if (
                isinstance(parent_frame, astroid.ClassDef)
                and node.name in REDEFINABLE_METHODS
            ):
                return

            dummy_variables_rgx = lint_utils.get_global_option(
                self, "dummy-variables-rgx", default=None
            )
            if dummy_variables_rgx and dummy_variables_rgx.match(node.name):
                return
            self.add_message(
                "function-redefined",
                node=node,
                args=(redeftype, defined_self.fromlineno),
            )
check for redefinition of a function / method / class name