DRYout a class-based chainable API
<p>I have written a chainable API (in a similar style to jQuery) as follows:</p>

<pre><code>class ChainableAPI:
  def show(self):
    self.visibility = 1
    return self

  def goBlue(self):
    self.color = 'Blue'
    return self

  def die(self):
    self.life = 0
    return self

chainableAPI = ChainableAPI()

(chainableAPI
  .goBlue()
  .show()
  .die()
  .goBlue())
</code></pre>

<p>Notice how each method of <code>ChainableAPI</code> ends with <code>return self</code>. Is there a way to have all methods to <code>return self</code> automatically? That way I do not have to specify <code>return self</code> manually for each method.</p>
