MCPcopy Index your code
hub / github.com/rocky/python-uncompyle6 / are_code_objects_equal

Function are_code_objects_equal

pytest/validate.py:96–111  ·  view source on GitHub ↗

Determine if two code objects are approximately equal, see are_instructions_equal for more information. :param i1: left code object to compare :param i2: right code object to compare :return: True if the two code objects are approximately equal, otherwise False.

(co1, co2)

Source from the content-addressed store, hash-verified

94
95
96def are_code_objects_equal(co1, co2):
97 """
98 Determine if two code objects are approximately equal,
99 see are_instructions_equal for more information.
100
101 :param i1: left code object to compare
102 :param i2: right code object to compare
103
104 :return: True if the two code objects are approximately equal, otherwise False.
105 """
106 instructions1 = Bytecode(co1)
107 instructions2 = Bytecode(co2)
108 for opcode1, opcode2 in zip(instructions1, instructions2):
109 if not are_instructions_equal(opcode1, opcode2):
110 return False
111 return True
112
113
114def validate_uncompyle(text, mode="exec"):

Callers 1

validate_uncompyleFunction · 0.85

Calls 1

are_instructions_equalFunction · 0.70

Tested by

no test coverage detected