Commit 4d795fe
committed
docs(conf): Fix mypy attr-defined error on py_domain.find_obj
why: env.get_domain() returns Domain, the base class, which does not
declare find_obj(). mypy correctly flags this as an attr-defined error
because find_obj is defined only on PythonDomain.
what:
- Import PythonDomain from sphinx.domains.python under TYPE_CHECKING
- Annotate py_domain as PythonDomain with a type: ignore[assignment]
comment to satisfy mypy while keeping the cast lightweight at runtime1 parent ad6251a commit 4d795fe
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
76 | | - | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| |||
0 commit comments