Skip to content

Commit daace2a

Browse files
committed
Handle type annotation the same attribute
Signed-off-by: Cristian Le <git@lecris.dev>
1 parent 18cc082 commit daace2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sphinx/ext/autodoc/_docstrings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def _get_docstring_lines(
244244
return []
245245
return [prepare_docstring(docstring, tab_width)]
246246

247-
if props.obj_type == 'attribute':
247+
if props.obj_type in {'attribute', 'type'}:
248248
# Check the attribute has a docstring-comment
249249
comment = _get_attribute_comment(
250250
parent=parent, obj_path=props.parts, attrname=props.parts[-1]

0 commit comments

Comments
 (0)