Skip to content

Instantly share code, notes, and snippets.

@laixintao
Created August 26, 2018 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laixintao/bb4330651c33124d52ff888b99c9e939 to your computer and use it in GitHub Desktop.
Save laixintao/bb4330651c33124d52ff888b99c9e939 to your computer and use it in GitHub Desktop.
In [4]: def func(a, b):
...: a, b = b ,a
...:
In [5]: dis.dis(func)
2 0 LOAD_FAST 1 (b)
2 LOAD_FAST 0 (a)
4 ROT_TWO
6 STORE_FAST 0 (a)
8 STORE_FAST 1 (b)
10 LOAD_CONST 0 (None)
12 RETURN_VALUE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment