title: Using string formatting within class method docstrings
body: <p>I have a class with several similar methods, each with long docstrings that are similar but vary with regards to several phrases/words.  I'd like to build a docstring template and then apply string formatting to it.  Below is a clumsy implementation where the <code>__doc__</code>s are defined after the class methods.</p>
  
  <pre><code>capture_doc = """
  %(direc)s normal.
  
  a %(sym)s b."""
  
  class Cls():    
      def a(self):
          pass
      def b(self):
          pass
      a.__doc__ = capture_doc % {'direc' : 'below', 'sym' : '&lt;'}     
      b.__doc__ = capture_doc % {'direc' : 'above', 'sym' : '&gt;'}
  
  c = Cls()    
  print(c.a.__doc__)
  
  below normal.
  
  a &lt; b.
  </code></pre>
  
  <p>Question: is there a Python docs- or PEP-prescribed way to do this?  I'd like to keep things basic, I've seen use of an <code>@Appender</code> <a href="https://github.com/pandas-dev/pandas/blob/v0.20.3/pandas/core/generic.py#L683" rel="nofollow noreferrer">decorator</a> but think that's a bit fancy for my needs.</p>