mirror of
https://github.com/python/cpython.git
synced 2025-07-22 18:55:22 +00:00
gh-128891: add specialized opcodes to opcode.opname (#128892)
This commit is contained in:
parent
256d6d2131
commit
5eee2fe2b0
4 changed files with 15 additions and 4 deletions
|
@ -38,6 +38,13 @@ class OpListTests(unittest.TestCase):
|
|||
opcodes = [dis.opmap[opname] for opname in names]
|
||||
self.check_bool_function_result(_opcode.is_valid, opcodes, True)
|
||||
|
||||
def test_opmaps(self):
|
||||
def check_roundtrip(name, map):
|
||||
return self.assertEqual(opcode.opname[map[name]], name)
|
||||
|
||||
check_roundtrip('BINARY_OP', opcode.opmap)
|
||||
check_roundtrip('BINARY_OP_ADD_INT', opcode._specialized_opmap)
|
||||
|
||||
def test_oplists(self):
|
||||
def check_function(self, func, expected):
|
||||
for op in [-10, 520]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue