Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> import dis
- >>> index = compile("container['a']", "<example>", "eval")
- >>> call = compile("container[ord('a')]", "<example>", "eval")
- >>> dis.dis(index)
- 1 0 LOAD_NAME 0 (container)
- 3 LOAD_CONST 0 ('a')
- 6 BINARY_SUBSCR
- 7 RETURN_VALUE
- >>> dis.dis(call)
- 1 0 LOAD_NAME 0 (container)
- 3 LOAD_NAME 1 (ord)
- 6 LOAD_CONST 0 ('a')
- 9 CALL_FUNCTION 1
- 12 BINARY_SUBSCR
- 13 RETURN_VALUE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement