File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/sphinx_autodoc_typehints Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -156,29 +156,29 @@ def format_annotation(
156
156
args_format = f"\\ [:py:data:`{ prefix } typing.Union`\\ [{{}}]]"
157
157
args = tuple (x for x in args if x is not type (None )) # noqa: E721
158
158
elif full_name == "typing.Callable" and args and args [0 ] is not ...:
159
- formatted_args = [
159
+ fmt = [
160
160
format_annotation (
161
161
arg ,
162
162
simplify_optional_unions = simplify_optional_unions ,
163
163
typehints_formatter = typehints_formatter ,
164
164
)
165
165
for arg in args
166
166
]
167
- formatted_args = f"\\ [\\ [{ ', ' .join (formatted_args [:- 1 ])} ], { formatted_args [- 1 ]} ]"
167
+ formatted_args = f"\\ [\\ [{ ', ' .join (fmt [:- 1 ])} ], { fmt [- 1 ]} ]"
168
168
elif full_name == "typing.Literal" :
169
169
formatted_args = f"\\ [{ ', ' .join (repr (arg ) for arg in args )} ]"
170
170
171
171
if args and not formatted_args :
172
- fmt = ", " . join (
172
+ fmt = [
173
173
format_annotation (
174
174
arg ,
175
175
fully_qualified = fully_qualified ,
176
176
simplify_optional_unions = simplify_optional_unions ,
177
177
typehints_formatter = typehints_formatter ,
178
178
)
179
179
for arg in args
180
- )
181
- formatted_args = args_format .format (fmt )
180
+ ]
181
+ formatted_args = args_format .format (", " . join ( fmt ) )
182
182
183
183
return f":py:{ role } :`{ prefix } { full_name } `{ formatted_args } "
184
184
You can’t perform that action at this time.
0 commit comments