Skip to content

Commit 7861e6a

Browse files
More precise types in preserve_defaults.py
Followup from python/typeshed#11880. Not all AST nodes have a lineno; in this file only parameter defaults are passed to this function, which are always ast.expr.
1 parent a51331c commit 7861e6a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎sphinx/ext/autodoc/preserve_defaults.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def _get_arguments_inner(x: Any, /) -> ast.arguments | None:
109109
return None
110110

111111

112-
def get_default_value(lines: list[str], position: ast.AST) -> str | None:
112+
def get_default_value(lines: list[str], position: ast.expr) -> str | None:
113113
try:
114114
if position.lineno == position.end_lineno:
115115
line = lines[position.lineno - 1]

0 commit comments

Comments
 (0)