reportMissingSuperCall.md

April 8, 2026 · View on GitHub

Overview

reportMissingSuperCall is a diagnostic in Pylance and Pyright that warns when a method in a subclass should call its superclass method (typically using super()), but does not. This is important for correct initialization and behavior in class hierarchies, especially with __init__ and other special methods.

Representative Issues

  • #3793: Ensure that the configuration settings for Pylance/Pyright are correctly applied to suppress errors in Python library files.
  • #3968: Ensure that the __init__ method of a class does not call super().__init__() unless it is necessary for proper inheritance and initialization.
  • #5887: Ensure that classes inheriting from abstract base classes implement all abstract methods.
  • #6376: Consider adding diagnostic rules to your configuration file instead of using the "all" default.

Examples

class Parent:
    def __init__(self):
        self.value = 0

class Child(Parent):
    # Warning: "__init__" does not call "super().__init__()"
    def __init__(self):
        self.name = "child"

Fix — add the super() call:

class Child(Parent):
    def __init__(self):
        super().__init__()
        self.name = "child"

Common Fixes & Workarounds

  1. Add a call to super() in subclass methods when required for correct initialization or behavior.
  2. Only call super() if the superclass method exists and needs to be invoked.
  3. Review class hierarchies to ensure proper method chaining and initialization.
  4. Review the Pyright configuration documentation for options to adjust or suppress this diagnostic if needed.

See Also