Skip to content

Commit

Permalink
pyi: remove workaround for missing variables in members
Browse files Browse the repository at this point in the history
this is fixed in pdoc 14
  • Loading branch information
mhils committed Sep 6, 2023
1 parent e48ed11 commit b2cf646
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions pdoc/doc_pyi.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,6 @@ def _patch_doc(target_doc: doc.Doc, stub_mod: doc.Module) -> None:
elif isinstance(target_doc, doc.Variable) and isinstance(stub_doc, doc.Variable):
target_doc.annotation = stub_doc.annotation
elif isinstance(target_doc, doc.Namespace) and isinstance(stub_doc, doc.Namespace):
# pdoc currently does not include variables without docstring in .members (not ideal),
# so the regular patching won't work. We manually copy over type annotations instead.
for k, v in stub_doc._var_annotations.items():
var = target_doc.members.get(k, None)
if isinstance(var, doc.Variable):
var.annotation = v

for m in target_doc.members.values():
_patch_doc(m, stub_mod)
else:
Expand Down

0 comments on commit b2cf646

Please sign in to comment.