Skip to content

Suppress missing docstrings on overloads

Suppresses PyCharm's missing docstring inspection for @overload signatures while keeping the implementation subject to the normal docstring rule.

from typing import overload

@overload
def parse(value: str) -> int: ...

@overload
def parse(value: bytes) -> int: ...

def parse(value: str | bytes) -> int:
    """Parse a numeric value."""
    return int(value)
# The overload signatures are not flagged for missing docstrings.
# The implementation still needs its own docstring.

Notes

  • Only missing-docstring inspection results on overload signatures are suppressed.
  • Ordinary functions and undocumented implementations continue to be reported.
  • The feature is gated by the Suppress missing docstrings on overloads setting under Settings | BetterPy | Code Quality & Safety | Code Inspections.