Skip to content

Instantly share code, notes, and snippets.

@ishashankkumar
Last active November 9, 2019 10:44
Show Gist options
  • Save ishashankkumar/622d2c5a6039ec4c2a8f9049ed4de9f0 to your computer and use it in GitHub Desktop.
Save ishashankkumar/622d2c5a6039ec4c2a8f9049ed4de9f0 to your computer and use it in GitHub Desktop.
import dis
print dis.dis(test_one_line_expression)
2 0 LOAD_FAST 1 (b)
3 LOAD_CONST 1 (1)
6 BINARY_ADD
7 LOAD_FAST 0 (a)
10 LOAD_FAST 1 (b)
13 BINARY_ADD
14 ROT_TWO
15 STORE_FAST 0 (a)
18 STORE_FAST 1 (b)
3 21 LOAD_FAST 0 (a)
24 LOAD_FAST 1 (b)
27 BUILD_TUPLE 2
30 RETURN_VALUE
None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment