diff --git a/doc/whatsnew/2/2.15/index.rst b/doc/whatsnew/2/2.15/index.rst index 3f3e34ba88..929f232509 100644 --- a/doc/whatsnew/2/2.15/index.rst +++ b/doc/whatsnew/2/2.15/index.rst @@ -33,6 +33,8 @@ Extensions False positives fixed ===================== +* Don't report ``super-init-not-called`` for subclasses of ``Enum`` (on Python >= 3.11). + * Don't report ``unsupported-binary-operation`` on Python <= 3.9 when using the ``|`` operator with types, if one has a metaclass that overloads ``__or__`` or ``__ror__`` as appropriate. diff --git a/pylint/checkers/classes/class_checker.py b/pylint/checkers/classes/class_checker.py index c345f41b59..561c400380 100644 --- a/pylint/checkers/classes/class_checker.py +++ b/pylint/checkers/classes/class_checker.py @@ -2059,6 +2059,11 @@ def _check_init(self, node: nodes.FunctionDef, klass_node: nodes.ClassDef) -> No except astroid.InferenceError: continue + # Skip if klass is Enum, Python's own docs and examples + # do not recommend Enum subclasses call Enum.__init__ + if klass.name == "Enum": + continue + if decorated_with(node, ["typing.overload"]): continue cls = node_frame_class(method)