Created
February 3, 2017 05:32
-
-
Save zhuangzhuang/106cd57612bb0b7fb4e84a483b9867b4 to your computer and use it in GitHub Desktop.
python中函数返回
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Python 2.7.9 Stackless 3.1b3 060516 (default, Feb 21 2015, 11:54:09) [MSC v.1500 32 bit (Intel)] | |
Type "copyright", "credits" or "license" for more information. | |
IPython 5.1.0 -- An enhanced Interactive Python. | |
? -> Introduction and overview of IPython's features. | |
%quickref -> Quick reference. | |
help -> Python's own help system. | |
object? -> Details about 'object', use 'object??' for extra details. | |
In [1]: def foo(): return | |
In [2]: import dis | |
In [3]: dis.dis(foo) | |
1 0 LOAD_CONST 0 (None) | |
3 RETURN_VALUE | |
In [4]: def foo(): pass | |
In [5]: dis.dis(foo) | |
1 0 LOAD_CONST 0 (None) | |
3 RETURN_VALUE | |
In [6]: def foo(): 1 | |
In [7]: dis.dis(foo) | |
1 0 LOAD_CONST 0 (None) | |
3 RETURN_VALUE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment