[pypy-commit] pypy py3.5: Implement pyopcode BUILD_SET_UNPACK

raffael_t pypy.commits at gmail.com
Fri Jun 3 15:03:11 EDT 2016


Author: Raffael Tfirst <raffael.tfirst at gmail.com>
Branch: py3.5
Changeset: r84912:282bcd4967a7
Date: 2016-06-03 21:02 +0200
http://bitbucket.org/pypy/pypy/changeset/282bcd4967a7/

Log:	Implement pyopcode BUILD_SET_UNPACK

diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py
--- a/pypy/interpreter/pyopcode.py
+++ b/pypy/interpreter/pyopcode.py
@@ -1326,11 +1326,12 @@
 
     def BUILD_SET_UNPACK(self, itemcount, next_instr):
         w_sum = self.space.newset()
-        for i in range(itemcount):
-            self.space.updateset() #implement?
-            w_item = self.popvalue()
-            self.space.call_method(w_set, 'add', w_item)
-        self.pushvalue(w_set)
+        for i in range(itemcount, 0, -1):
+            self.space.call_method(w_sum, 'update', self.space.peek(i))
+        while itemcount != 0:
+            self.popvalue()
+            itemcount -= 1
+        self.pushvalue(w_sum)
 
     def BUILD_TUPLE_UNPACK(self, itemcount, next_instr):
         w_sum = self.space.newset()


More information about the pypy-commit mailing list