diff --git a/pdoc/doc_pyi.py b/pdoc/doc_pyi.py index d4169262..f78d70a3 100644 --- a/pdoc/doc_pyi.py +++ b/pdoc/doc_pyi.py @@ -77,7 +77,8 @@ def _prepare_module(ns: doc.Namespace) -> None: # at the moment, .members is the only lazy property that is accessed. for member in ns.members.values(): - if isinstance(member, doc.Class): + # prevent infinite recursion for nested classes derived from the outer class + if isinstance(member, doc.Class) and not member.is_inherited: _prepare_module(member)