File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55## Unreleased: pdoc next
66
7+ - Fix a bug where type aliases wouldn't be linked.
8+ ([ #798 ] ( https://github.com/mitmproxy/pdoc/pull/798 ) , @mhils )
79- Fix a bug where invalid Numpydoc docstrings would raise an exception.
810 ([ #789 ] ( https://github.com/mitmproxy/pdoc/pull/789 ) , @mhils )
911- Improve debuggability of docstring processing
Original file line number Diff line number Diff line change @@ -1169,6 +1169,9 @@ def annotation_str(self) -> str:
11691169 """The variable's type annotation as a pretty-printed str."""
11701170 if self .annotation is not empty :
11711171 formatted = formatannotation (self .annotation )
1172+ # type aliases don't include the module name in their __repr__, so we add it here.
1173+ if isinstance (self .annotation , TypeAliasType ):
1174+ formatted = f"{ self .annotation .__module__ } .{ formatted } "
11721175 return f": { _remove_collections_abc (formatted )} "
11731176 else :
11741177 return ""
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ <h1 class="modulename">
130130 </ section >
131131 < section id ="foo ">
132132 < div class ="attr variable ">
133- < span class ="name "> foo</ span > < span class ="annotation "> : MyType</ span >
133+ < span class ="name "> foo</ span > < span class ="annotation "> : < a href =" # MyType" > MyType </ a > </ span >
134134
135135
136136 </ div >
Original file line number Diff line number Diff line change 11<module misc_py312 # Testing features tha…
22 <var MyType = int # A custom Python 3.12…>
3- <var foo: MyType # A custom type instan…>
3+ <var foo: misc_py312. MyType # A custom type instan…>
44 <var MyTypeWithoutDocstring = int>
55 <var MyTypeClassic: TypeAlias = int # inherited from builtins.int, A "classic" typing.T…>
66 <class misc_py312.NamedTupleExample # An example for a typ…
You can’t perform that action at this time.
0 commit comments