Skip to content

Commit f9cedff

Browse files
authored
ast: allow non-literal strings (#6566)
Co-authored-by: hauntsaninja <>
1 parent 53eae77 commit f9cedff

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

stdlib/ast.pyi

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,15 @@ if sys.version_info >= (3, 8):
215215
type_comments: bool = ...,
216216
feature_version: None | int | _typing.Tuple[int, int] = ...,
217217
) -> Interactive: ...
218+
@overload
219+
def parse(
220+
source: str | bytes,
221+
filename: str | bytes = ...,
222+
mode: str = ...,
223+
*,
224+
type_comments: bool = ...,
225+
feature_version: None | int | _typing.Tuple[int, int] = ...,
226+
) -> AST: ...
218227

219228
else:
220229
@overload
@@ -227,6 +236,8 @@ else:
227236
def parse(source: str | bytes, *, mode: Literal["eval"]) -> Expression: ...
228237
@overload
229238
def parse(source: str | bytes, *, mode: Literal["single"]) -> Interactive: ...
239+
@overload
240+
def parse(source: str | bytes, filename: str | bytes = ..., mode: str = ...) -> AST: ...
230241

231242
if sys.version_info >= (3, 9):
232243
def unparse(ast_obj: AST) -> str: ...

0 commit comments

Comments
 (0)