Skip to content

Commit 5500c5e

Browse files
committed
Ignore symbols starting with __ in the linkcode resolver
Pydantic models add a lot of these, which cause the autodoc typehints to fail
1 parent de24020 commit 5500c5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def linkcode_resolve(repo_link: str, domain: str, info: dict[str, str]) -> str |
9494

9595
pos = _global_assign_pos(source, symbol_name)
9696
if pos is None:
97-
if symbol_name in ("model_config", "model_fields", "model_computed_fields"):
97+
if symbol_name in ("model_config", "model_fields", "model_computed_fields") or symbol_name.startswith("__"):
9898
# These are ClassVars added by pydantic.
9999
# Since they're not in our source code, we cannot resolve them to a url.
100100
return None

0 commit comments

Comments
 (0)