Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Doc/whatsnew/3.9.rst
Original file line number Diff line number Diff line change
Expand Up @@ -667,9 +667,10 @@ Removed
defining ``COUNT_ALLOCS`` macro.
(Contributed by Victor Stinner in :issue:`39489`.)

* The ``ast.Suite`` and ``ast.Param`` node classes has been removed due to no
longer being needed.
(Contributed by Batuhan Taskaya in :issue:`39639` and :issue:`39969`.)
* The ``ast.Suite``, ``ast.Param``, ``ast.AugLoad`` and ``ast.AugStore``
node classes have been removed due to no longer being needed.
(Contributed by Batuhan Taskaya in :issue:`39639` and :issue:`39969`
and Serhiy Storchaka in :issue:`39988`.)


Porting to Python 3.9
Expand Down
3 changes: 1 addition & 2 deletions Include/Python-ast.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Removed ``ast.AugLoad`` and ``ast.AugStore`` node classes because they are
no longer used.
2 changes: 1 addition & 1 deletion Parser/Python.asdl
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ module Python
-- 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)

expr_context = Load | Store | Del | AugLoad | AugStore
expr_context = Load | Store | Del

boolop = And | Or

Expand Down
62 changes: 1 addition & 61 deletions Python/Python-ast.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 1 addition & 12 deletions Python/ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ expr_context_name(expr_context_ty ctx)
return "Store";
case Del:
return "Del";
case AugLoad:
return "AugLoad";
case AugStore:
return "AugStore";
default:
Py_UNREACHABLE();
}
Expand Down Expand Up @@ -1099,14 +1095,7 @@ set_context(struct compiling *c, expr_ty e, expr_context_ty ctx, const node *n)
{
asdl_seq *s = NULL;

/* The ast defines augmented store and load contexts, but the
implementation here doesn't actually use them. The code may be
a little more complex than necessary as a result. It also means
that expressions in an augmented assignment have a Store context.
Consider restructuring so that augmented assignment uses
set_context(), too.
*/
assert(ctx != AugStore && ctx != AugLoad);
/* Expressions in an augmented assignment have a Store context. */

switch (e->kind) {
case Attribute_kind:
Expand Down
Loading