`pyright --verifytypes` doesn't see docstring if docstring is placed within base clas
Author: CheVianaCreated Sep 27, 2026Updated Sep 28, 2026
Labelsbug
Describe the bug
pyright --verifytypes doesn't see docstring if docstring is placed within base class. Python's inspect.getdoc discovers such docstring, and many typing aids do too.
Code or Screenshots Example and instructions in https://github.com/CheViana/docstring_example/
from abc import ABC, abstractmethod
class MyBaseClass(ABC):
"""
Base class docstring.
"""
__slots__ = ()
@abstractmethod
def method1(self) -> None:
"""
method1 docstring - MyBaseClass
"""
...
class MyMixin(MyBaseClass):
__slots__ = ()
@abstractmethod
def method2(self) -> None:
"""
method2 docstring - MyMixin
"""
...
class MyOtherMixin(MyBaseClass):
__slots__ = ()
@abstractmethod
def method3(self) -> None:
"""
method3 docstring - MyOtherMixin
"""
...
class MyClass(MyMixin, MyOtherMixin):
def method1(self) -> None:
print("hello from MyClass.method1")
def method2(self) -> None:
print("hello from MyClass.method2")
def method3(self) -> None:
print("hello from MyClass.method3")inspect that class with pyright --verifytypes - it doesn't see docstrings.
> pyright --verifytypes docstring_example
Symbols without documentation:
Functions without docstring: 3
Functions without default param: 0
Classes without docstring: 3Hence reports issues with type completeness. Inspecting with Python's inspect.getdoc inspect.getdoc(MyClass) does see docstrings.
Full steps to reproduce https://github.com/CheViana/docstring_example/blob/main/steps.sh
VS Code extension or command-line
standalone tool. version pyright==1.1.411 . Tried with latest 414 too, same
Source: microsoft/pyright