Skip to content

Instantly share code, notes, and snippets.

@zhuangzhuang
Created February 3, 2017 05:32
Show Gist options
  • Save zhuangzhuang/106cd57612bb0b7fb4e84a483b9867b4 to your computer and use it in GitHub Desktop.
Save zhuangzhuang/106cd57612bb0b7fb4e84a483b9867b4 to your computer and use it in GitHub Desktop.

Revisions

  1. zhuangzhuang created this gist Feb 3, 2017.
    28 changes: 28 additions & 0 deletions pass vs return.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    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