title: Python docstrings are unexpectedly None
body: <p>When I create a class with method like this:</p>
  
  
  
  <pre class="lang-py prettyprint-override"><code>class Foo:
      """ A class """
      def bar():
          " Hello world "
          pass
  </code></pre>
  
  <p>I would expect the <code>__doc__</code> to return the first statement of the method, since both are strings. Unfortunately, this does not happen:  </p>
  
  <pre class="lang-py prettyprint-override"><code>print(Foo.__doc__)
  print(Foo().__doc__)
  print(Foo.bar.__doc__)
  print(Foo().bar.__doc__)
  </code></pre>
  
  <p>outputs <code>None</code> 4 times. Also the example here</p>
  
  <p><a href="https://docs.python.org/3.4/library/functools.html?highlight=__doc__#functools.wraps" rel="nofollow">https://docs.python.org/3.4/library/functools.html?highlight=<strong>doc</strong>#functools.wraps</a></p>
  
  <p>seems to fail, as the docstring is <code>None</code> for me:</p>
  
  <pre class="lang-py prettyprint-override"><code>from functools import wraps
  def my_decorator(f):
      @wraps(f)
      def wrapper(*args, **kwds):
          print('Calling decorated function')
          return f(*args, **kwds)
      return wrapper
  
  @my_decorator
  def example():
      """Docstring"""
      print('Called example function')
  print(example.__doc__)
  </code></pre>
  
  <p>Which also prints <code>None</code>.</p>
  
  <p>Why are the <code>__doc__</code>'s not set to the specified strings?</p>
  
  <p>ideone snipplet: <a href="http://ideone.com/cZNUQe" rel="nofollow">http://ideone.com/cZNUQe</a></p>