# HG changeset patch # User Paul Boddie # Date 1716289171 -7200 # Node ID 3668fc79dbdf078054fa984c5759f32abaf33b42 # Parent e8ff2a117367b904684095bebdf96d1a0ab2b2d8 Fixed augmented assignment operations on sequence items. diff -r e8ff2a117367 -r 3668fc79dbdf common.py --- a/common.py Mon May 20 00:55:39 2024 +0200 +++ b/common.py Tue May 21 12:59:31 2024 +0200 @@ -381,6 +381,8 @@ target = compiler.ast.AssAttr(n.node.expr, n.node.attrname, "OP_ASSIGN") elif isinstance(n.node, compiler.ast.Name): target = compiler.ast.AssName(n.node.name, "OP_ASSIGN") + elif isinstance(n.node, compiler.ast.Subscript): + target = compiler.ast.Subscript(n.node.expr, "OP_ASSIGN", n.node.subs) else: target = n.node diff -r e8ff2a117367 -r 3668fc79dbdf tests/list.py --- a/tests/list.py Mon May 20 00:55:39 2024 +0200 +++ b/tests/list.py Tue May 21 12:59:31 2024 +0200 @@ -97,3 +97,8 @@ e.reverse() print e # [2, 1, 3] + +# Test augmented operations. + +e[0] += e[1] +print e # [3, 1, 3]