title: How do I reference the name of the current class in Sphinx?
body: <p>Say that I have a class structure as follows:</p>
  <pre class="lang-py prettyprint-override"><code>class A:
    def print(self, x):
       r&quot;&quot;&quot;Prints x.
  
       Example::
  
          &gt;&gt;&gt; a = A()
          &gt;&gt;&gt; A.print(3)
       &quot;&quot;&quot;
       print(x)
  
  class B(A): pass
  </code></pre>
  <p>When printing the documentation for <code>B.print</code>, the example would stated with the parent class <code>A</code>, which is annoying.</p>
  <p>My questions are:</p>
  <ol>
  <li><p>Is it possible to reference the name of the current class when writing the documentation in Sphinx?</p>
  <p>If not, assume that the documentation in <code>A.print</code> is quite large, so copying the whole documentation just to change the name of the class would be quite annoying. Then,</p>
  </li>
  <li><p>What would be the best way to implement the behaviour above?</p>
  </li>
  </ol>