Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (synapse_353) foo@vbar:$ python
- Python 3.5.3 (default, Apr 10 2017, 19:09:11)
- [GCC 5.4.0 20160609] on linux
- Type "help", "copyright", "credits" or "license" for more information.
- Running from /home/foo/.pythonrc
- Loading [os]
- Loading [sys]
- Loading [json]
- Loading [base64]
- Loading [logging]
- Loading [collections]
- Loading [pprint as pprint]
- Reload not found in builtin, defining reload()
- Bound "tab" as autocomplete key.
- Done loading from [/home/foo/.pythonrc]
- >>> def f1(a, b):
- ... if a != b:
- ... raise Exception
- ... return str(a)
- ...
- >>> def f2(a, b):
- ... assert a == b
- ... return str(a)
- ...
- >>> import dis
- >>> dis.dis(f1)
- 2 0 LOAD_FAST 0 (a)
- 3 LOAD_FAST 1 (b)
- 6 COMPARE_OP 3 (!=)
- 9 POP_JUMP_IF_FALSE 18
- 3 12 LOAD_GLOBAL 0 (Exception)
- 15 RAISE_VARARGS 1
- 4 >> 18 LOAD_GLOBAL 1 (str)
- 21 LOAD_FAST 0 (a)
- 24 CALL_FUNCTION 1 (1 positional, 0 keyword pair)
- 27 RETURN_VALUE
- >>> dis.dis(f2)
- 2 0 LOAD_FAST 0 (a)
- 3 LOAD_FAST 1 (b)
- 6 COMPARE_OP 2 (==)
- 9 POP_JUMP_IF_TRUE 18
- 12 LOAD_GLOBAL 0 (AssertionError)
- 15 RAISE_VARARGS 1
- 3 >> 18 LOAD_GLOBAL 1 (str)
- 21 LOAD_FAST 0 (a)
- 24 CALL_FUNCTION 1 (1 positional, 0 keyword pair)
- 27 RETURN_VALUE
- >>> exit()
- (synapse_353) foo@vbar:$ python -O
- Python 3.5.3 (default, Apr 10 2017, 19:09:11)
- [GCC 5.4.0 20160609] on linux
- Type "help", "copyright", "credits" or "license" for more information.
- Running from /home/foo/.pythonrc
- Loading [os]
- Loading [sys]
- Loading [json]
- Loading [base64]
- Loading [logging]
- Loading [collections]
- Loading [pprint as pprint]
- Reload not found in builtin, defining reload()
- Bound "tab" as autocomplete key.
- Done loading from [/home/foo/.pythonrc]
- >>> def f2_o(a, b):
- ... assert a == b
- ... return str(a)
- ...
- >>> import dis
- >>> dis.dis(f2_o)
- 3 0 LOAD_GLOBAL 0 (str)
- 3 LOAD_FAST 0 (a)
- 6 CALL_FUNCTION 1 (1 positional, 0 keyword pair)
- 9 RETURN_VALUE
- >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement