From ab71ccde33355b422325aeea6315a95b24c7e049 Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Fri, 10 Dec 2021 21:00:38 -0800 Subject: [PATCH] ast: allow non-literal strings --- stdlib/ast.pyi | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/stdlib/ast.pyi b/stdlib/ast.pyi index 94d76f6cff5a..8494a3a99126 100644 --- a/stdlib/ast.pyi +++ b/stdlib/ast.pyi @@ -215,6 +215,15 @@ if sys.version_info >= (3, 8): type_comments: bool = ..., feature_version: None | int | _typing.Tuple[int, int] = ..., ) -> Interactive: ... + @overload + def parse( + source: str | bytes, + filename: str | bytes = ..., + mode: str = ..., + *, + type_comments: bool = ..., + feature_version: None | int | _typing.Tuple[int, int] = ..., + ) -> AST: ... else: @overload @@ -227,6 +236,8 @@ else: def parse(source: str | bytes, *, mode: Literal["eval"]) -> Expression: ... @overload def parse(source: str | bytes, *, mode: Literal["single"]) -> Interactive: ... + @overload + def parse(source: str | bytes, filename: str | bytes = ..., mode: str = ...) -> AST: ... if sys.version_info >= (3, 9): def unparse(ast_obj: AST) -> str: ...