Author: Raffael Tfirst <[email protected]>
Branch: py3.5
Changeset: r85384:a131597a62b3
Date: 2016-06-26 20:01 +0200
http://bitbucket.org/pypy/pypy/changeset/a131597a62b3/
Log: Implement pyopcode build_list_unpack
diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py
--- a/pypy/interpreter/pyopcode.py
+++ b/pypy/interpreter/pyopcode.py
@@ -1355,16 +1355,18 @@
#self.pushvalue(w_sum)
def BUILD_LIST_UNPACK(self, itemcount, next_instr):
- self.BUILD_LIST(itemcount, next_instr)
- #w_sum = self.space.newlist()
- #for i in range(itemcount, 0, -1):
- # w_item = self.popvalue()
- # #self.space.peek(i)
- # self.space.call_method(w_sum, 'update', w_item)
- ##while itemcount != 0:
- ## self.popvalue()
- ## itemcount -= 1
- #self.pushvalue(w_sum)
+ w_sum = []
+ for i in range(itemcount, 0, -1):
+ #for i in range(0, itemcount):
+ #w_item = self.popvalue()
+ w_item = self.peekvalue(i-1)
+ items = self.space.fixedview(w_item)
+ w_sum.extend(items)
+ #w_sum.append(w_item)
+ while itemcount != 0:
+ self.popvalue()
+ itemcount -= 1
+ self.pushvalue(self.space.newlist(w_sum))
#TODO
#get intersection, store as setentry
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit