@@ -736,7 +736,7 @@ async def async_def():
736
736
Argument count: 0
737
737
Kw-only arguments: 0
738
738
Number of locals: 2
739
- Stack size: 10
739
+ Stack size: 9
740
740
Flags: OPTIMIZED, NEWLOCALS, NOFREE, COROUTINE
741
741
Constants:
742
742
0: None
@@ -962,7 +962,7 @@ def jumpy():
962
962
Instruction (opname = 'LOAD_CONST' , opcode = 100 , arg = 6 , argval = 'Who let lolcatz into this test suite?' , argrepr = "'Who let lolcatz into this test suite?'" , offset = 96 , starts_line = None , is_jump_target = False ),
963
963
Instruction (opname = 'CALL_FUNCTION' , opcode = 131 , arg = 1 , argval = 1 , argrepr = '' , offset = 98 , starts_line = None , is_jump_target = False ),
964
964
Instruction (opname = 'POP_TOP' , opcode = 1 , arg = None , argval = None , argrepr = '' , offset = 100 , starts_line = None , is_jump_target = False ),
965
- Instruction (opname = 'SETUP_FINALLY' , opcode = 122 , arg = 70 , argval = 174 , argrepr = 'to 174 ' , offset = 102 , starts_line = 20 , is_jump_target = True ),
965
+ Instruction (opname = 'SETUP_FINALLY' , opcode = 122 , arg = 90 , argval = 194 , argrepr = 'to 194 ' , offset = 102 , starts_line = 20 , is_jump_target = True ),
966
966
Instruction (opname = 'SETUP_FINALLY' , opcode = 122 , arg = 12 , argval = 118 , argrepr = 'to 118' , offset = 104 , starts_line = None , is_jump_target = False ),
967
967
Instruction (opname = 'LOAD_CONST' , opcode = 100 , arg = 5 , argval = 1 , argrepr = '1' , offset = 106 , starts_line = 21 , is_jump_target = False ),
968
968
Instruction (opname = 'LOAD_CONST' , opcode = 100 , arg = 7 , argval = 0 , argrepr = '0' , offset = 108 , starts_line = None , is_jump_target = False ),
@@ -982,29 +982,39 @@ def jumpy():
982
982
Instruction (opname = 'CALL_FUNCTION' , opcode = 131 , arg = 1 , argval = 1 , argrepr = '' , offset = 136 , starts_line = None , is_jump_target = False ),
983
983
Instruction (opname = 'POP_TOP' , opcode = 1 , arg = None , argval = None , argrepr = '' , offset = 138 , starts_line = None , is_jump_target = False ),
984
984
Instruction (opname = 'POP_EXCEPT' , opcode = 89 , arg = None , argval = None , argrepr = '' , offset = 140 , starts_line = None , is_jump_target = False ),
985
- Instruction (opname = 'JUMP_FORWARD' , opcode = 110 , arg = 26 , argval = 170 , argrepr = 'to 170 ' , offset = 142 , starts_line = None , is_jump_target = False ),
985
+ Instruction (opname = 'JUMP_FORWARD' , opcode = 110 , arg = 46 , argval = 190 , argrepr = 'to 190 ' , offset = 142 , starts_line = None , is_jump_target = False ),
986
986
Instruction (opname = 'END_FINALLY' , opcode = 88 , arg = None , argval = None , argrepr = '' , offset = 144 , starts_line = None , is_jump_target = True ),
987
987
Instruction (opname = 'LOAD_FAST' , opcode = 124 , arg = 0 , argval = 'i' , argrepr = 'i' , offset = 146 , starts_line = 25 , is_jump_target = True ),
988
- Instruction (opname = 'SETUP_WITH' , opcode = 143 , arg = 14 , argval = 164 , argrepr = 'to 164 ' , offset = 148 , starts_line = None , is_jump_target = False ),
988
+ Instruction (opname = 'SETUP_WITH' , opcode = 143 , arg = 24 , argval = 174 , argrepr = 'to 174 ' , offset = 148 , starts_line = None , is_jump_target = False ),
989
989
Instruction (opname = 'STORE_FAST' , opcode = 125 , arg = 1 , argval = 'dodgy' , argrepr = 'dodgy' , offset = 150 , starts_line = None , is_jump_target = False ),
990
990
Instruction (opname = 'LOAD_GLOBAL' , opcode = 116 , arg = 1 , argval = 'print' , argrepr = 'print' , offset = 152 , starts_line = 26 , is_jump_target = False ),
991
991
Instruction (opname = 'LOAD_CONST' , opcode = 100 , arg = 9 , argval = 'Never reach this' , argrepr = "'Never reach this'" , offset = 154 , starts_line = None , is_jump_target = False ),
992
992
Instruction (opname = 'CALL_FUNCTION' , opcode = 131 , arg = 1 , argval = 1 , argrepr = '' , offset = 156 , starts_line = None , is_jump_target = False ),
993
993
Instruction (opname = 'POP_TOP' , opcode = 1 , arg = None , argval = None , argrepr = '' , offset = 158 , starts_line = None , is_jump_target = False ),
994
994
Instruction (opname = 'POP_BLOCK' , opcode = 87 , arg = None , argval = None , argrepr = '' , offset = 160 , starts_line = None , is_jump_target = False ),
995
- Instruction (opname = 'BEGIN_FINALLY' , opcode = 53 , arg = None , argval = None , argrepr = '' , offset = 162 , starts_line = None , is_jump_target = False ),
996
- Instruction (opname = 'WITH_CLEANUP_START' , opcode = 81 , arg = None , argval = None , argrepr = '' , offset = 164 , starts_line = None , is_jump_target = True ),
997
- Instruction (opname = 'WITH_CLEANUP_FINISH' , opcode = 82 , arg = None , argval = None , argrepr = '' , offset = 166 , starts_line = None , is_jump_target = False ),
998
- Instruction (opname = 'END_FINALLY' , opcode = 88 , arg = None , argval = None , argrepr = '' , offset = 168 , starts_line = None , is_jump_target = False ),
999
- Instruction (opname = 'POP_BLOCK' , opcode = 87 , arg = None , argval = None , argrepr = '' , offset = 170 , starts_line = None , is_jump_target = True ),
1000
- Instruction (opname = 'BEGIN_FINALLY' , opcode = 53 , arg = None , argval = None , argrepr = '' , offset = 172 , starts_line = None , is_jump_target = False ),
1001
- Instruction (opname = 'LOAD_GLOBAL' , opcode = 116 , arg = 1 , argval = 'print' , argrepr = 'print' , offset = 174 , starts_line = 28 , is_jump_target = True ),
1002
- Instruction (opname = 'LOAD_CONST' , opcode = 100 , arg = 10 , argval = "OK, now we're done" , argrepr = '"OK, now we\' re done"' , offset = 176 , starts_line = None , is_jump_target = False ),
1003
- Instruction (opname = 'CALL_FUNCTION' , opcode = 131 , arg = 1 , argval = 1 , argrepr = '' , offset = 178 , starts_line = None , is_jump_target = False ),
1004
- Instruction (opname = 'POP_TOP' , opcode = 1 , arg = None , argval = None , argrepr = '' , offset = 180 , starts_line = None , is_jump_target = False ),
1005
- Instruction (opname = 'END_FINALLY' , opcode = 88 , arg = None , argval = None , argrepr = '' , offset = 182 , starts_line = None , is_jump_target = False ),
1006
- Instruction (opname = 'LOAD_CONST' , opcode = 100 , arg = 0 , argval = None , argrepr = 'None' , offset = 184 , starts_line = None , is_jump_target = False ),
1007
- Instruction (opname = 'RETURN_VALUE' , opcode = 83 , arg = None , argval = None , argrepr = '' , offset = 186 , starts_line = None , is_jump_target = False ),
995
+ Instruction (opname = 'LOAD_CONST' , opcode = 100 , arg = 0 , argval = None , argrepr = 'None' , offset = 162 , starts_line = None , is_jump_target = False ),
996
+ Instruction (opname = 'DUP_TOP' , opcode = 4 , arg = None , argval = None , argrepr = '' , offset = 164 , starts_line = None , is_jump_target = False ),
997
+ Instruction (opname = 'DUP_TOP' , opcode = 4 , arg = None , argval = None , argrepr = '' , offset = 166 , starts_line = None , is_jump_target = False ),
998
+ Instruction (opname = 'CALL_FUNCTION' , opcode = 131 , arg = 3 , argval = 3 , argrepr = '' , offset = 168 , starts_line = None , is_jump_target = False ),
999
+ Instruction (opname = 'POP_TOP' , opcode = 1 , arg = None , argval = None , argrepr = '' , offset = 170 , starts_line = None , is_jump_target = False ),
1000
+ Instruction (opname = 'JUMP_FORWARD' , opcode = 110 , arg = 16 , argval = 190 , argrepr = 'to 190' , offset = 172 , starts_line = None , is_jump_target = False ),
1001
+ Instruction (opname = 'WITH_EXCEPT_START' , opcode = 54 , arg = None , argval = None , argrepr = '' , offset = 174 , starts_line = None , is_jump_target = True ),
1002
+ Instruction (opname = 'POP_JUMP_IF_TRUE' , opcode = 115 , arg = 180 , argval = 180 , argrepr = '' , offset = 176 , starts_line = None , is_jump_target = False ),
1003
+ Instruction (opname = 'RERAISE' , opcode = 48 , arg = None , argval = None , argrepr = '' , offset = 178 , starts_line = None , is_jump_target = False ),
1004
+ Instruction (opname = 'POP_TOP' , opcode = 1 , arg = None , argval = None , argrepr = '' , offset = 180 , starts_line = None , is_jump_target = True ),
1005
+ Instruction (opname = 'POP_TOP' , opcode = 1 , arg = None , argval = None , argrepr = '' , offset = 182 , starts_line = None , is_jump_target = False ),
1006
+ Instruction (opname = 'POP_TOP' , opcode = 1 , arg = None , argval = None , argrepr = '' , offset = 184 , starts_line = None , is_jump_target = False ),
1007
+ Instruction (opname = 'POP_EXCEPT' , opcode = 89 , arg = None , argval = None , argrepr = '' , offset = 186 , starts_line = None , is_jump_target = False ),
1008
+ Instruction (opname = 'POP_TOP' , opcode = 1 , arg = None , argval = None , argrepr = '' , offset = 188 , starts_line = None , is_jump_target = False ),
1009
+ Instruction (opname = 'POP_BLOCK' , opcode = 87 , arg = None , argval = None , argrepr = '' , offset = 190 , starts_line = None , is_jump_target = True ),
1010
+ Instruction (opname = 'BEGIN_FINALLY' , opcode = 53 , arg = None , argval = None , argrepr = '' , offset = 192 , starts_line = None , is_jump_target = False ),
1011
+ Instruction (opname = 'LOAD_GLOBAL' , opcode = 116 , arg = 1 , argval = 'print' , argrepr = 'print' , offset = 194 , starts_line = 28 , is_jump_target = True ),
1012
+ Instruction (opname = 'LOAD_CONST' , opcode = 100 , arg = 10 , argval = "OK, now we're done" , argrepr = '"OK, now we\' re done"' , offset = 196 , starts_line = None , is_jump_target = False ),
1013
+ Instruction (opname = 'CALL_FUNCTION' , opcode = 131 , arg = 1 , argval = 1 , argrepr = '' , offset = 198 , starts_line = None , is_jump_target = False ),
1014
+ Instruction (opname = 'POP_TOP' , opcode = 1 , arg = None , argval = None , argrepr = '' , offset = 200 , starts_line = None , is_jump_target = False ),
1015
+ Instruction (opname = 'END_FINALLY' , opcode = 88 , arg = None , argval = None , argrepr = '' , offset = 202 , starts_line = None , is_jump_target = False ),
1016
+ Instruction (opname = 'LOAD_CONST' , opcode = 100 , arg = 0 , argval = None , argrepr = 'None' , offset = 204 , starts_line = None , is_jump_target = False ),
1017
+ Instruction (opname = 'RETURN_VALUE' , opcode = 83 , arg = None , argval = None , argrepr = '' , offset = 206 , starts_line = None , is_jump_target = False )
1008
1018
]
1009
1019
1010
1020
# One last piece of inspect fodder to check the default line number handling
@@ -1017,6 +1027,10 @@ def simple(): pass
1017
1027
1018
1028
class InstructionTests (BytecodeTestCase ):
1019
1029
1030
+ def __init__ (self , * args ):
1031
+ super ().__init__ (* args )
1032
+ self .maxDiff = None
1033
+
1020
1034
def test_default_first_line (self ):
1021
1035
actual = dis .get_instructions (simple )
1022
1036
self .assertEqual (list (actual ), expected_opinfo_simple )
@@ -1048,6 +1062,7 @@ def test_jumpy(self):
1048
1062
# get_instructions has its own tests above, so can rely on it to validate
1049
1063
# the object oriented API
1050
1064
class BytecodeTests (unittest .TestCase ):
1065
+
1051
1066
def test_instantiation (self ):
1052
1067
# Test with function, method, code string and code object
1053
1068
for obj in [_f , _C (1 ).__init__ , "a=1" , _f .__code__ ]:
0 commit comments