Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kragen/38562 to your computer and use it in GitHub Desktop.
Save kragen/38562 to your computer and use it in GitHub Desktop.
>>> def f():
... a = 1
... b = 2
... a, b = b, a
...
>>> import dis
>>> dis.dis(f)
2 0 LOAD_CONST 1 (1)
3 STORE_FAST 0 (a)
3 6 LOAD_CONST 2 (2)
9 STORE_FAST 1 (b)
4 12 LOAD_FAST 1 (b)
15 LOAD_FAST 0 (a)
18 ROT_TWO
19 STORE_FAST 0 (a)
22 STORE_FAST 1 (b)
25 LOAD_CONST 0 (None)
28 RETURN_VALUE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment