Skip to content

Commit 601cea2

Browse files
committed
remove DUP_TOP_TWO
1 parent 43584ab commit 601cea2

2 files changed

Lines changed: 14 additions & 18 deletions

File tree

interpreter/byterun/pyvm2.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,6 @@ def byte_POP_TOP(self):
264264
def byte_DUP_TOP(self):
265265
self.push(self.top())
266266

267-
def byte_DUP_TOP_TWO(self):
268-
a, b = self.popn(2)
269-
self.push(a, b, a, b)
270-
271267
def byte_ROT_TWO(self):
272268
a, b = self.popn(2)
273269
self.push(b, a)

interpreter/tests/test_basic.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -187,23 +187,23 @@ def test_set_comprehension(self):
187187
assert x == {0, 1, 4, 9, 16}
188188
""")
189189

190-
def test_strange_sequence_ops(self):
191-
# from stdlib: test/test_augassign.py
192-
self.assert_ok("""\
193-
x = [1,2]
194-
x += [3,4]
195-
x *= 2
190+
# def test_strange_sequence_ops(self): # relies on DUP_TOP_TWO
191+
# # from stdlib: test/test_augassign.py
192+
# self.assert_ok("""\
193+
# x = [1,2]
194+
# x += [3,4]
195+
# x *= 2
196196

197-
assert x == [1, 2, 3, 4, 1, 2, 3, 4]
197+
# assert x == [1, 2, 3, 4, 1, 2, 3, 4]
198198

199-
x = [1, 2, 3]
200-
y = x
201-
x[1:2] *= 2
202-
y[1:2] += [1]
199+
# x = [1, 2, 3]
200+
# y = x
201+
# x[1:2] *= 2
202+
# y[1:2] += [1]
203203

204-
assert x == [1, 2, 1, 2, 3]
205-
assert x is y
206-
""")
204+
# assert x == [1, 2, 1, 2, 3]
205+
# assert x is y
206+
# """)
207207

208208
def test_unary_operators(self):
209209
self.assert_ok("""\

0 commit comments

Comments
 (0)