Skip to content

Instantly share code, notes, and snippets.

@zhuangzhuang
Created February 3, 2017 05:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhuangzhuang/106cd57612bb0b7fb4e84a483b9867b4 to your computer and use it in GitHub Desktop.
Save zhuangzhuang/106cd57612bb0b7fb4e84a483b9867b4 to your computer and use it in GitHub Desktop.
python中函数返回
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