[pypy-commit] pypy py3.5: Adapt _visit_list_or_tuple_assignment

raffael_t pypy.commits at gmail.com
Thu Jun 16 17:39:35 EDT 2016


Author: Raffael Tfirst <raffael.tfirst at gmail.com>
Branch: py3.5
Changeset: r85202:430c5404f5b9
Date: 2016-06-16 23:38 +0200
http://bitbucket.org/pypy/pypy/changeset/430c5404f5b9/

Log:	Adapt _visit_list_or_tuple_assignment

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
@@ -1017,7 +1017,7 @@
         ifexp.orelse.walkabout(self)
         self.use_next_block(end)
 
-    def _visit_list_or_tuple(self, node, elts, ctx, op):
+    def _visit_list_or_tuple_starunpack(self, node, elts, ctx, op):
         #TODO
         elt_count = len(elts) if elts else 0
         if ctx == ast.Store:
@@ -1041,7 +1041,8 @@
         if ctx == ast.Load:
             self.emit_op_arg(op, elt_count)
     
-    def _visit_starunpack(self, node, elts, ctx, single_op, innter_op, outer_op):
+    #_visit_starunpack
+    def _visit_list_or_tuple_assignment(self, node, elts, ctx, single_op, innter_op, outer_op):
         elt_count = len(elts) if elts else 0
         if ctx == ast.Store:
             seen_star = False
@@ -1061,8 +1062,8 @@
             if not seen_star:
                 self.emit_op_arg(ops.UNPACK_SEQUENCE, elt_count)
         self.visit_sequence(elts)
-        if ctx == ast.Load:
-            self.emit_op_arg(op, elt_count)
+        #if ctx == ast.Load:
+        #    self.emit_op_arg(op, elt_count)
 
     def visit_Starred(self, star):
         if star.ctx != ast.Store:
@@ -1076,7 +1077,7 @@
             self._visit_list_or_tuple_assignment(l, l.elts)
         elif l.ctx == ast.Load:
             self._visit_list_or_tuple_starunpack(tup, tup.elts, tup.ctx, ops.BUILD_TUPLE)
-        else
+        else:
             self.visit_sequence(l.elts)
 
     def visit_List(self, l):
@@ -1085,7 +1086,7 @@
             self._visit_list_or_tuple_assignment(l, l.elts)
         elif l.ctx == ast.Load:
             self._visit_list_or_tuple_starunpack(l, l.elts, l.ctx, ops.BUILD_LIST)
-        else
+        else:
             self.visit_sequence(l.elts)
 
     def visit_Dict(self, d):


More information about the pypy-commit mailing list