diff --git a/pdoc/doc_ast.py b/pdoc/doc_ast.py index e42bb7ef..4c4faeff 100644 --- a/pdoc/doc_ast.py +++ b/pdoc/doc_ast.py @@ -245,7 +245,7 @@ def _parse_class(source: str) -> ast.ClassDef: t = tree.body[0] assert isinstance(t, ast.ClassDef) return t - return ast.ClassDef(body=[], decorator_list=[]) # type: ignore + return ast.ClassDef(name="pdocEmpty", body=[], decorator_list=[]) # type: ignore @cache @@ -265,7 +265,7 @@ def _parse_function(source: str) -> ast.FunctionDef | ast.AsyncFunctionDef: # we have a lambda function, # to simplify the API return the ast.FunctionDef stub. pass - return ast.FunctionDef(body=[], decorator_list=[]) # type: ignore + return ast.FunctionDef(name="pdoc_empty", body=[], decorator_list=[]) # type: ignore def _parse(