diff --git a/docs/contributing/ast/python3_9.ast b/docs/contributing/ast/python3_9.ast index cfd3717..3dd6a15 100755 --- a/docs/contributing/ast/python3_9.ast +++ b/docs/contributing/ast/python3_9.ast @@ -1,4 +1,4 @@ --- Python 3.8 AST +-- Python 3.9 AST -- ASDL's 4 builtin types are: -- identifier, int, string, constant @@ -10,57 +10,57 @@ module Python version "3.9" | FunctionType(expr* argtypes, expr returns) stmt = FunctionDef(identifier name, - arguments args, - stmt* body, - expr* decorator_list, - expr? returns, - string? type_comment) - | AsyncFunctionDef(identifier name, - arguments args, - stmt* body, - expr* decorator_list, - expr? returns, - string? type_comment) - - | ClassDef(identifier name, - expr* bases, - keyword* keywords, + arguments args, stmt* body, - expr* decorator_list) - | Return(expr? value) - - | Delete(expr* targets) - | Assign(expr* targets, expr value, string? type_comment) - | AugAssign(expr target, operator op, expr value) - -- 'simple' indicates that we annotate simple name without parens - | AnnAssign(expr target, expr annotation, expr? value, int simple) - - -- use 'orelse' because else is a keyword in target languages - | For(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment) - | AsyncFor(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment) - | While(expr test, stmt* body, stmt* orelse) - | If(expr test, stmt* body, stmt* orelse) - | With(withitem* items, stmt* body, string? type_comment) - | AsyncWith(withitem* items, stmt* body, string? type_comment) - - | Raise(expr? exc, expr? cause) - | Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* finalbody) - | Assert(expr test, expr? msg) - - | Import(alias* names) - | ImportFrom(identifier? module, alias* names, int? level) - - | Global(identifier* names) - | Nonlocal(identifier* names) - | Expr(expr value) - | Pass - | Break - | Continue - - -- col_offset is the byte offset in the utf8 string the parser uses - attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset) - - -- BoolOp() can use left & right? + expr* decorator_list, + expr? returns, + string? type_comment) + | AsyncFunctionDef(identifier name, + arguments args, + stmt* body, + expr* decorator_list, + expr? returns, + string? type_comment) + + | ClassDef(identifier name, + expr* bases, + keyword* keywords, + stmt* body, + expr* decorator_list) + | Return(expr? value) + + | Delete(expr* targets) + | Assign(expr* targets, expr value, string? type_comment) + | AugAssign(expr target, operator op, expr value) + -- 'simple' indicates that we annotate simple name without parens + | AnnAssign(expr target, expr annotation, expr? value, int simple) + + -- use 'orelse' because else is a keyword in target languages + | For(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment) + | AsyncFor(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment) + | While(expr test, stmt* body, stmt* orelse) + | If(expr test, stmt* body, stmt* orelse) + | With(withitem* items, stmt* body, string? type_comment) + | AsyncWith(withitem* items, stmt* body, string? type_comment) + + | Raise(expr? exc, expr? cause) + | Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* finalbody) + | Assert(expr test, expr? msg) + + | Import(alias* names) + | ImportFrom(identifier? module, alias* names, int? level) + + | Global(identifier* names) + | Nonlocal(identifier* names) + | Expr(expr value) + | Pass + | Break + | Continue + + -- col_offset is the byte offset in the utf8 string the parser uses + attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset) + + -- BoolOp() can use left & right? expr = BoolOp(boolop op, expr* values) | NamedExpr(expr target, expr value) | BinOp(expr left, operator op, expr right) diff --git a/docs/contributing/changes_from38to39.rst b/docs/contributing/changes_from38to39.rst index 6ece5d5..a040b03 100644 --- a/docs/contributing/changes_from38to39.rst +++ b/docs/contributing/changes_from38to39.rst @@ -1,5 +1,5 @@ -Changes from Python 3.7 to Python 3.8 +Changes from Python 3.8 to Python 3.9 ------------------------------------- -.. literalinclude:: ast/python3_8.ast - :diff: ast/python3_7.ast +.. literalinclude:: ast/python3_9.ast + :diff: ast/python3_8.ast