Author: Carl Friedrich Bolz-Tereick <[email protected]>
Branch: py3.6
Changeset: r96445:07207a5d3411
Date: 2019-04-11 12:14 +0200
http://bitbucket.org/pypy/pypy/changeset/07207a5d3411/

Log:    test and fix for issue #2995

diff --git a/pypy/interpreter/astcompiler/codegen.py 
b/pypy/interpreter/astcompiler/codegen.py
--- a/pypy/interpreter/astcompiler/codegen.py
+++ b/pypy/interpreter/astcompiler/codegen.py
@@ -923,6 +923,9 @@
         values_count = len(values)
         if targets_count != values_count:
             return False
+        for value in values:
+            if isinstance(value, ast.Starred):
+                return False # more complicated
         for target in targets:
             if not isinstance(target, ast.Name):
                 if isinstance(target, ast.Starred):
diff --git a/pypy/interpreter/astcompiler/test/test_compiler.py 
b/pypy/interpreter/astcompiler/test/test_compiler.py
--- a/pypy/interpreter/astcompiler/test/test_compiler.py
+++ b/pypy/interpreter/astcompiler/test/test_compiler.py
@@ -1115,6 +1115,13 @@
         """
         yield self.st, func, "f()", [4, 5, 6, 7]
 
+        func = """def f():
+            b = [4,]
+            x, y = (*b, 7)
+            return x
+        """
+        yield self.st, func, "f()", 4
+
 
     def test_extended_unpacking_fail(self):
         exc = py.test.raises(SyntaxError, self.simple_test, "*a, *b = [1, 2]",
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to