Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. >>> import dis
  2. >>> index = compile("container['a']", "<example>", "eval")
  3. >>> call = compile("container[ord('a')]", "<example>", "eval")
  4. >>> dis.dis(index)
  5.   1           0 LOAD_NAME                0 (container)
  6.               3 LOAD_CONST               0 ('a')
  7.               6 BINARY_SUBSCR      
  8.               7 RETURN_VALUE        
  9. >>> dis.dis(call)
  10.   1           0 LOAD_NAME                0 (container)
  11.               3 LOAD_NAME                1 (ord)
  12.               6 LOAD_CONST               0 ('a')
  13.               9 CALL_FUNCTION            1
  14.              12 BINARY_SUBSCR      
  15.              13 RETURN_VALUE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement