Skip to content

Instantly share code, notes, and snippets.

@paultag
Created June 2, 2015 00:43
Show Gist options
  • Save paultag/5b16cad69a979ce3fda6 to your computer and use it in GitHub Desktop.
Save paultag/5b16cad69a979ce3fda6 to your computer and use it in GitHub Desktop.
>>> import dis
>>> def x():
... print(True)
...
>>> dis.dis(x)
2 0 LOAD_GLOBAL 0 (True)
3 PRINT_ITEM
4 PRINT_NEWLINE
5 LOAD_CONST 0 (None)
8 RETURN_VALUE
>>> def x():
... print(foo)
...
>>> dis.dis(x)
2 0 LOAD_GLOBAL 0 (foo)
3 PRINT_ITEM
4 PRINT_NEWLINE
5 LOAD_CONST 0 (None)
8 RETURN_VALUE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment