@@ -149,17 +149,16 @@ def bug1333982(x=[]):
149
149
dis_bug1333982 = """\
150
150
%3d 0 LOAD_ASSERTION_ERROR
151
151
2 LOAD_CONST 2 (<code object <listcomp> at 0x..., file "%s", line %d>)
152
- 4 LOAD_CONST 3 ('bug1333982.<locals>.<listcomp>')
153
- 6 MAKE_FUNCTION 0
154
- 8 LOAD_FAST 0 (x)
155
- 10 GET_ITER
156
- 12 CALL_FUNCTION 1
152
+ 4 MAKE_FUNCTION 0
153
+ 6 LOAD_FAST 0 (x)
154
+ 8 GET_ITER
155
+ 10 CALL_FUNCTION 1
157
156
158
- %3d 14 LOAD_CONST 4 (1)
157
+ %3d 12 LOAD_CONST 3 (1)
159
158
160
- %3d 16 BINARY_ADD
161
- 18 CALL_FUNCTION 1
162
- 20 RAISE_VARARGS 1
159
+ %3d 14 BINARY_ADD
160
+ 16 CALL_FUNCTION 1
161
+ 18 RAISE_VARARGS 1
163
162
""" % (bug1333982 .__code__ .co_firstlineno + 1 ,
164
163
__file__ ,
165
164
bug1333982 .__code__ .co_firstlineno + 1 ,
@@ -432,12 +431,11 @@ def foo(x):
432
431
%3d 2 LOAD_CLOSURE 0 (y)
433
432
4 BUILD_TUPLE 1
434
433
6 LOAD_CONST 1 (<code object foo at 0x..., file "%s", line %d>)
435
- 8 LOAD_CONST 2 ('_h.<locals>.foo')
436
- 10 MAKE_FUNCTION 8 (closure)
437
- 12 STORE_FAST 1 (foo)
434
+ 8 MAKE_FUNCTION 8 (closure)
435
+ 10 STORE_FAST 1 (foo)
438
436
439
- %3d 14 LOAD_FAST 1 (foo)
440
- 16 RETURN_VALUE
437
+ %3d 12 LOAD_FAST 1 (foo)
438
+ 14 RETURN_VALUE
441
439
""" % (_h .__code__ .co_firstlineno + 1 ,
442
440
__file__ ,
443
441
_h .__code__ .co_firstlineno + 1 ,
@@ -451,12 +449,11 @@ def foo(x):
451
449
%3d 2 LOAD_CLOSURE 0 (x)
452
450
4 BUILD_TUPLE 1
453
451
6 LOAD_CONST 1 (<code object <listcomp> at 0x..., file "%s", line %d>)
454
- 8 LOAD_CONST 2 ('_h.<locals>.foo.<locals>.<listcomp>')
455
- 10 MAKE_FUNCTION 8 (closure)
456
- 12 LOAD_DEREF 1 (y)
457
- 14 GET_ITER
458
- 16 CALL_FUNCTION 1
459
- 18 RETURN_VALUE
452
+ 8 MAKE_FUNCTION 8 (closure)
453
+ 10 LOAD_DEREF 1 (y)
454
+ 12 GET_ITER
455
+ 14 CALL_FUNCTION 1
456
+ 16 RETURN_VALUE
460
457
""" % (dis_nested_0 ,
461
458
__file__ ,
462
459
_h .__code__ .co_firstlineno + 1 ,
@@ -747,7 +744,6 @@ def f(c=c):
747
744
Constants:
748
745
0: None
749
746
1: <code object f at (.*), file "(.*)", line (.*)>
750
- 2: 'tricky.<locals>.f'
751
747
Variable names:
752
748
0: a
753
749
1: b
@@ -975,51 +971,49 @@ def _prepare_test_cases():
975
971
expected_opinfo_outer = [
976
972
Instruction (opname = 'MAKE_CELL' , opcode = 135 , arg = 0 , argval = 'a' , argrepr = 'a' , offset = 0 , starts_line = None , is_jump_target = False , positions = None ),
977
973
Instruction (opname = 'MAKE_CELL' , opcode = 135 , arg = 1 , argval = 'b' , argrepr = 'b' , offset = 2 , starts_line = None , is_jump_target = False , positions = None ),
978
- Instruction (opname = 'LOAD_CONST' , opcode = 100 , arg = 8 , argval = (3 , 4 ), argrepr = '(3, 4)' , offset = 4 , starts_line = 2 , is_jump_target = False , positions = None ),
974
+ Instruction (opname = 'LOAD_CONST' , opcode = 100 , arg = 7 , argval = (3 , 4 ), argrepr = '(3, 4)' , offset = 4 , starts_line = 2 , is_jump_target = False , positions = None ),
979
975
Instruction (opname = 'LOAD_CLOSURE' , opcode = 136 , arg = 0 , argval = 'a' , argrepr = 'a' , offset = 6 , starts_line = None , is_jump_target = False , positions = None ),
980
976
Instruction (opname = 'LOAD_CLOSURE' , opcode = 136 , arg = 1 , argval = 'b' , argrepr = 'b' , offset = 8 , starts_line = None , is_jump_target = False , positions = None ),
981
977
Instruction (opname = 'BUILD_TUPLE' , opcode = 102 , arg = 2 , argval = 2 , argrepr = '' , offset = 10 , starts_line = None , is_jump_target = False , positions = None ),
982
978
Instruction (opname = 'LOAD_CONST' , opcode = 100 , arg = 3 , argval = code_object_f , argrepr = repr (code_object_f ), offset = 12 , starts_line = None , is_jump_target = False , positions = None ),
983
- Instruction (opname = 'LOAD_CONST' , opcode = 100 , arg = 4 , argval = 'outer.<locals>.f' , argrepr = "'outer.<locals>.f'" , offset = 14 , starts_line = None , is_jump_target = False , positions = None ),
984
- Instruction (opname = 'MAKE_FUNCTION' , opcode = 132 , arg = 9 , argval = 9 , argrepr = 'defaults, closure' , offset = 16 , starts_line = None , is_jump_target = False , positions = None ),
985
- Instruction (opname = 'STORE_FAST' , opcode = 125 , arg = 2 , argval = 'f' , argrepr = 'f' , offset = 18 , starts_line = None , is_jump_target = False , positions = None ),
986
- Instruction (opname = 'LOAD_GLOBAL' , opcode = 116 , arg = 0 , argval = 'print' , argrepr = 'print' , offset = 20 , starts_line = 7 , is_jump_target = False , positions = None ),
987
- Instruction (opname = 'LOAD_DEREF' , opcode = 137 , arg = 0 , argval = 'a' , argrepr = 'a' , offset = 22 , starts_line = None , is_jump_target = False , positions = None ),
988
- Instruction (opname = 'LOAD_DEREF' , opcode = 137 , arg = 1 , argval = 'b' , argrepr = 'b' , offset = 24 , starts_line = None , is_jump_target = False , positions = None ),
989
- Instruction (opname = 'LOAD_CONST' , opcode = 100 , arg = 5 , argval = '' , argrepr = "''" , offset = 26 , starts_line = None , is_jump_target = False , positions = None ),
990
- Instruction (opname = 'LOAD_CONST' , opcode = 100 , arg = 6 , argval = 1 , argrepr = '1' , offset = 28 , starts_line = None , is_jump_target = False , positions = None ),
991
- Instruction (opname = 'BUILD_LIST' , opcode = 103 , arg = 0 , argval = 0 , argrepr = '' , offset = 30 , starts_line = None , is_jump_target = False , positions = None ),
992
- Instruction (opname = 'BUILD_MAP' , opcode = 105 , arg = 0 , argval = 0 , argrepr = '' , offset = 32 , starts_line = None , is_jump_target = False , positions = None ),
993
- Instruction (opname = 'LOAD_CONST' , opcode = 100 , arg = 7 , argval = 'Hello world!' , argrepr = "'Hello world!'" , offset = 34 , starts_line = None , is_jump_target = False , positions = None ),
994
- Instruction (opname = 'CALL_FUNCTION' , opcode = 131 , arg = 7 , argval = 7 , argrepr = '' , offset = 36 , starts_line = None , is_jump_target = False , positions = None ),
995
- Instruction (opname = 'POP_TOP' , opcode = 1 , arg = None , argval = None , argrepr = '' , offset = 38 , starts_line = None , is_jump_target = False , positions = None ),
996
- Instruction (opname = 'LOAD_FAST' , opcode = 124 , arg = 2 , argval = 'f' , argrepr = 'f' , offset = 40 , starts_line = 8 , is_jump_target = False , positions = None ),
997
- Instruction (opname = 'RETURN_VALUE' , opcode = 83 , arg = None , argval = None , argrepr = '' , offset = 42 , starts_line = None , is_jump_target = False , positions = None ),
979
+ Instruction (opname = 'MAKE_FUNCTION' , opcode = 132 , arg = 9 , argval = 9 , argrepr = 'defaults, closure' , offset = 14 , starts_line = None , is_jump_target = False , positions = None ),
980
+ Instruction (opname = 'STORE_FAST' , opcode = 125 , arg = 2 , argval = 'f' , argrepr = 'f' , offset = 16 , starts_line = None , is_jump_target = False , positions = None ),
981
+ Instruction (opname = 'LOAD_GLOBAL' , opcode = 116 , arg = 0 , argval = 'print' , argrepr = 'print' , offset = 18 , starts_line = 7 , is_jump_target = False , positions = None ),
982
+ Instruction (opname = 'LOAD_DEREF' , opcode = 137 , arg = 0 , argval = 'a' , argrepr = 'a' , offset = 20 , starts_line = None , is_jump_target = False , positions = None ),
983
+ Instruction (opname = 'LOAD_DEREF' , opcode = 137 , arg = 1 , argval = 'b' , argrepr = 'b' , offset = 22 , starts_line = None , is_jump_target = False , positions = None ),
984
+ Instruction (opname = 'LOAD_CONST' , opcode = 100 , arg = 4 , argval = '' , argrepr = "''" , offset = 24 , starts_line = None , is_jump_target = False , positions = None ),
985
+ Instruction (opname = 'LOAD_CONST' , opcode = 100 , arg = 5 , argval = 1 , argrepr = '1' , offset = 26 , starts_line = None , is_jump_target = False , positions = None ),
986
+ Instruction (opname = 'BUILD_LIST' , opcode = 103 , arg = 0 , argval = 0 , argrepr = '' , offset = 28 , starts_line = None , is_jump_target = False , positions = None ),
987
+ Instruction (opname = 'BUILD_MAP' , opcode = 105 , arg = 0 , argval = 0 , argrepr = '' , offset = 30 , starts_line = None , is_jump_target = False , positions = None ),
988
+ Instruction (opname = 'LOAD_CONST' , opcode = 100 , arg = 6 , argval = 'Hello world!' , argrepr = "'Hello world!'" , offset = 32 , starts_line = None , is_jump_target = False , positions = None ),
989
+ Instruction (opname = 'CALL_FUNCTION' , opcode = 131 , arg = 7 , argval = 7 , argrepr = '' , offset = 34 , starts_line = None , is_jump_target = False , positions = None ),
990
+ Instruction (opname = 'POP_TOP' , opcode = 1 , arg = None , argval = None , argrepr = '' , offset = 36 , starts_line = None , is_jump_target = False , positions = None ),
991
+ Instruction (opname = 'LOAD_FAST' , opcode = 124 , arg = 2 , argval = 'f' , argrepr = 'f' , offset = 38 , starts_line = 8 , is_jump_target = False , positions = None ),
992
+ Instruction (opname = 'RETURN_VALUE' , opcode = 83 , arg = None , argval = None , argrepr = '' , offset = 40 , starts_line = None , is_jump_target = False , positions = None ),
998
993
]
999
994
1000
995
1001
996
expected_opinfo_f = [
1002
997
Instruction (opname = 'MAKE_CELL' , opcode = 135 , arg = 0 , argval = 'c' , argrepr = 'c' , offset = 0 , starts_line = None , is_jump_target = False , positions = None ),
1003
998
Instruction (opname = 'MAKE_CELL' , opcode = 135 , arg = 1 , argval = 'd' , argrepr = 'd' , offset = 2 , starts_line = None , is_jump_target = False , positions = None ),
1004
- Instruction (opname = 'LOAD_CONST' , opcode = 100 , arg = 5 , argval = (5 , 6 ), argrepr = '(5, 6)' , offset = 4 , starts_line = 3 , is_jump_target = False , positions = None ),
999
+ Instruction (opname = 'LOAD_CONST' , opcode = 100 , arg = 4 , argval = (5 , 6 ), argrepr = '(5, 6)' , offset = 4 , starts_line = 3 , is_jump_target = False , positions = None ),
1005
1000
Instruction (opname = 'LOAD_CLOSURE' , opcode = 136 , arg = 3 , argval = 'a' , argrepr = 'a' , offset = 6 , starts_line = None , is_jump_target = False , positions = None ),
1006
1001
Instruction (opname = 'LOAD_CLOSURE' , opcode = 136 , arg = 4 , argval = 'b' , argrepr = 'b' , offset = 8 , starts_line = None , is_jump_target = False , positions = None ),
1007
1002
Instruction (opname = 'LOAD_CLOSURE' , opcode = 136 , arg = 0 , argval = 'c' , argrepr = 'c' , offset = 10 , starts_line = None , is_jump_target = False , positions = None ),
1008
1003
Instruction (opname = 'LOAD_CLOSURE' , opcode = 136 , arg = 1 , argval = 'd' , argrepr = 'd' , offset = 12 , starts_line = None , is_jump_target = False , positions = None ),
1009
1004
Instruction (opname = 'BUILD_TUPLE' , opcode = 102 , arg = 4 , argval = 4 , argrepr = '' , offset = 14 , starts_line = None , is_jump_target = False , positions = None ),
1010
1005
Instruction (opname = 'LOAD_CONST' , opcode = 100 , arg = 3 , argval = code_object_inner , argrepr = repr (code_object_inner ), offset = 16 , starts_line = None , is_jump_target = False , positions = None ),
1011
- Instruction (opname = 'LOAD_CONST' , opcode = 100 , arg = 4 , argval = 'outer.<locals>.f.<locals>.inner' , argrepr = "'outer.<locals>.f.<locals>.inner'" , offset = 18 , starts_line = None , is_jump_target = False , positions = None ),
1012
- Instruction (opname = 'MAKE_FUNCTION' , opcode = 132 , arg = 9 , argval = 9 , argrepr = 'defaults, closure' , offset = 20 , starts_line = None , is_jump_target = False , positions = None ),
1013
- Instruction (opname = 'STORE_FAST' , opcode = 125 , arg = 2 , argval = 'inner' , argrepr = 'inner' , offset = 22 , starts_line = None , is_jump_target = False , positions = None ),
1014
- Instruction (opname = 'LOAD_GLOBAL' , opcode = 116 , arg = 0 , argval = 'print' , argrepr = 'print' , offset = 24 , starts_line = 5 , is_jump_target = False , positions = None ),
1015
- Instruction (opname = 'LOAD_DEREF' , opcode = 137 , arg = 3 , argval = 'a' , argrepr = 'a' , offset = 26 , starts_line = None , is_jump_target = False , positions = None ),
1016
- Instruction (opname = 'LOAD_DEREF' , opcode = 137 , arg = 4 , argval = 'b' , argrepr = 'b' , offset = 28 , starts_line = None , is_jump_target = False , positions = None ),
1017
- Instruction (opname = 'LOAD_DEREF' , opcode = 137 , arg = 0 , argval = 'c' , argrepr = 'c' , offset = 30 , starts_line = None , is_jump_target = False , positions = None ),
1018
- Instruction (opname = 'LOAD_DEREF' , opcode = 137 , arg = 1 , argval = 'd' , argrepr = 'd' , offset = 32 , starts_line = None , is_jump_target = False , positions = None ),
1019
- Instruction (opname = 'CALL_FUNCTION' , opcode = 131 , arg = 4 , argval = 4 , argrepr = '' , offset = 34 , starts_line = None , is_jump_target = False , positions = None ),
1020
- Instruction (opname = 'POP_TOP' , opcode = 1 , arg = None , argval = None , argrepr = '' , offset = 36 , starts_line = None , is_jump_target = False , positions = None ),
1021
- Instruction (opname = 'LOAD_FAST' , opcode = 124 , arg = 2 , argval = 'inner' , argrepr = 'inner' , offset = 38 , starts_line = 6 , is_jump_target = False , positions = None ),
1022
- Instruction (opname = 'RETURN_VALUE' , opcode = 83 , arg = None , argval = None , argrepr = '' , offset = 40 , starts_line = None , is_jump_target = False , positions = None ),
1006
+ Instruction (opname = 'MAKE_FUNCTION' , opcode = 132 , arg = 9 , argval = 9 , argrepr = 'defaults, closure' , offset = 18 , starts_line = None , is_jump_target = False , positions = None ),
1007
+ Instruction (opname = 'STORE_FAST' , opcode = 125 , arg = 2 , argval = 'inner' , argrepr = 'inner' , offset = 20 , starts_line = None , is_jump_target = False , positions = None ),
1008
+ Instruction (opname = 'LOAD_GLOBAL' , opcode = 116 , arg = 0 , argval = 'print' , argrepr = 'print' , offset = 22 , starts_line = 5 , is_jump_target = False , positions = None ),
1009
+ Instruction (opname = 'LOAD_DEREF' , opcode = 137 , arg = 3 , argval = 'a' , argrepr = 'a' , offset = 24 , starts_line = None , is_jump_target = False , positions = None ),
1010
+ Instruction (opname = 'LOAD_DEREF' , opcode = 137 , arg = 4 , argval = 'b' , argrepr = 'b' , offset = 26 , starts_line = None , is_jump_target = False , positions = None ),
1011
+ Instruction (opname = 'LOAD_DEREF' , opcode = 137 , arg = 0 , argval = 'c' , argrepr = 'c' , offset = 28 , starts_line = None , is_jump_target = False , positions = None ),
1012
+ Instruction (opname = 'LOAD_DEREF' , opcode = 137 , arg = 1 , argval = 'd' , argrepr = 'd' , offset = 30 , starts_line = None , is_jump_target = False , positions = None ),
1013
+ Instruction (opname = 'CALL_FUNCTION' , opcode = 131 , arg = 4 , argval = 4 , argrepr = '' , offset = 32 , starts_line = None , is_jump_target = False , positions = None ),
1014
+ Instruction (opname = 'POP_TOP' , opcode = 1 , arg = None , argval = None , argrepr = '' , offset = 34 , starts_line = None , is_jump_target = False , positions = None ),
1015
+ Instruction (opname = 'LOAD_FAST' , opcode = 124 , arg = 2 , argval = 'inner' , argrepr = 'inner' , offset = 36 , starts_line = 6 , is_jump_target = False , positions = None ),
1016
+ Instruction (opname = 'RETURN_VALUE' , opcode = 83 , arg = None , argval = None , argrepr = '' , offset = 38 , starts_line = None , is_jump_target = False , positions = None ),
1023
1017
]
1024
1018
1025
1019
expected_opinfo_inner = [
0 commit comments