Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Python 2.7.5 (default, Mar 9 2014, 22:15:05)
- [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
- Type "help", "copyright", "credits" or "license" for more information.
- >>> def literal():
- ... return "the red cat".split(" ")
- ...
- >>> def explicit():
- ... return str.split("the red cat", " ")
- ...
- >>> import dis
- >>> dis.dis(literal)
- 2 0 LOAD_CONST 1 ('the red cat')
- 3 LOAD_ATTR 0 (split)
- 6 LOAD_CONST 2 (' ')
- 9 CALL_FUNCTION 1
- 12 RETURN_VALUE
- >>> dis.dis(explicit)
- 2 0 LOAD_GLOBAL 0 (str)
- 3 LOAD_ATTR 1 (split)
- 6 LOAD_CONST 1 ('the red cat')
- 9 LOAD_CONST 2 (' ')
- 12 CALL_FUNCTION 2
- 15 RETURN_VALUE
- >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement