Created
April 5, 2014 03:44
-
-
Save satiani/9987221 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def a(): | |
try: | |
return True | |
finally: | |
return False | |
print "The result of the function is: %s" % a() | |
print "The disassembly is:" | |
import dis | |
dis.dis(a) | |
================= | |
The result of the function is: False | |
The disassembly is: | |
2 0 SETUP_FINALLY 8 (to 11) | |
3 3 LOAD_GLOBAL 0 (True) | |
6 RETURN_VALUE | |
7 POP_BLOCK | |
8 LOAD_CONST 0 (None) | |
5 >> 11 LOAD_GLOBAL 1 (False) | |
14 RETURN_VALUE | |
15 END_FINALLY |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment