-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
source:
x = 1
def foo():
print(x)
x += 1
foo()
dis output:
0 RESUME 0
1 LOAD_CONST 0 (1)
STORE_NAME 0 (x)
2 LOAD_CONST 1 (<code object foo at 0x60e3e8094eb0, file "example.py", line 2>)
MAKE_FUNCTION
STORE_NAME 1 (foo)
5 LOAD_NAME 1 (foo)
PUSH_NULL
CALL 0
POP_TOP
RETURN_CONST 2 (None)
foo
2 RESUME 0
3 LOAD_GLOBAL 1 (print + NULL)
LOAD_FAST_CHECK 0 (x)
CALL 1
POP_TOP
4 LOAD_FAST 0 (x)
LOAD_CONST 1 (1)
BINARY_OP 13 (+=)
STORE_FAST 0 (x)
RETURN_CONST 0 (None)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
