Skip to content

Commit 8427e09

Browse files
authored
ast.get_docstring: fix return type (#4595)
Resolves #4575
1 parent bf5651e commit 8427e09

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

stdlib/3/ast.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ else:
191191
def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ...
192192

193193
def fix_missing_locations(node: _T) -> _T: ...
194-
def get_docstring(node: AST, clean: bool = ...) -> str: ...
194+
def get_docstring(node: AST, clean: bool = ...) -> Optional[str]: ...
195195
def increment_lineno(node: _T, n: int = ...) -> _T: ...
196196
def iter_child_nodes(node: AST) -> Iterator[AST]: ...
197197
def iter_fields(node: AST) -> Iterator[_typing.Tuple[str, Any]]: ...

third_party/3/typed_ast/ast3.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def parse(source: Union[str, bytes], filename: Union[str, bytes] = ..., mode: st
1212
def copy_location(new_node: AST, old_node: AST) -> AST: ...
1313
def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ...
1414
def fix_missing_locations(node: AST) -> AST: ...
15-
def get_docstring(node: AST, clean: bool = ...) -> str: ...
15+
def get_docstring(node: AST, clean: bool = ...) -> Optional[str]: ...
1616
def increment_lineno(node: AST, n: int = ...) -> AST: ...
1717
def iter_child_nodes(node: AST) -> Iterator[AST]: ...
1818
def iter_fields(node: AST) -> Iterator[typing.Tuple[str, Any]]: ...

0 commit comments

Comments
 (0)