Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> dis("""a = 'hello'
- ... try:
- ... n = int(a)
- ... except:
- ... pass
- ... """
- ... )
- 1 0 LOAD_CONST 0 ('hello')
- 2 STORE_NAME 0 (a)
- 2 4 SETUP_FINALLY 12 (to 18)
- 3 6 LOAD_NAME 1 (int)
- 8 LOAD_NAME 0 (a)
- 10 CALL_FUNCTION 1
- 12 STORE_NAME 2 (n)
- 14 POP_BLOCK
- 16 JUMP_FORWARD 12 (to 30)
- 4 >> 18 POP_TOP
- 20 POP_TOP
- 22 POP_TOP
- 5 24 POP_EXCEPT
- 26 JUMP_FORWARD 2 (to 30)
- 28 RERAISE
- >> 30 LOAD_CONST 1 (None)
- 32 RETURN_VALUE
- >>> dis("""a = 'hello'
- ... if a.isdigit():
- ... n = int(a)
- ... else:
- ... pass
- ... """)
- 1 0 LOAD_CONST 0 ('hello')
- 2 STORE_NAME 0 (a)
- 2 4 LOAD_NAME 0 (a)
- 6 LOAD_METHOD 1 (isdigit)
- 8 CALL_METHOD 0
- 10 POP_JUMP_IF_FALSE 22
- 3 12 LOAD_NAME 2 (int)
- 14 LOAD_NAME 0 (a)
- 16 CALL_FUNCTION 1
- 18 STORE_NAME 3 (n)
- 20 JUMP_FORWARD 0 (to 22)
- 5 >> 22 LOAD_CONST 1 (None)
- 24 RETURN_VALUE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement