title: How do I display the code of a Python function?
body: <p>I defined a function in a Python interactive console (not idle, not ipython) and I needed to see it again many screenfuls later.</p>
  
  <p>Example:</p>
  
  <pre><code>&gt;&gt;&gt; def myf():  
  ...    print 1
  ...    print 2
  ...    print 3
  ...
  &gt;&gt;&gt;
  &gt;&gt;&gt; # a lot of scrolling
  &gt;&gt;&gt;  
  </code></pre>
  
  <p>Fake example output below (instead of "name 'print_function' is not defined") to demonstrate what I want:</p>
  
  <pre><code>&gt;&gt;&gt; print_function(myf)
  myf()
      print 1
      print 2
      print 3
  </code></pre>
  
  <p>Is there anything like print_function in Python? If not, how would you implement it?</p>