title: Python function chaining an unknown number of times
body: <p>Is there a way in Python to chain the same function an unknown number of times on an object?</p>
  
  <p>For example. If I wanted to chain the function <code>fn</code> on the object <code>obj</code> twice I'd have:</p>
  
  <pre><code>obj.fn(**kwargs1).fn(**kwargs2)
  </code></pre>
  
  <p>If I wanted to chain a <code>fn</code> five times I'd have:</p>
  
  <pre><code>obj.fn(**kwargs1).fn(**kwargs2).fn(**kwargs3).fn(**kwargs4).fn(**kwargs5)
  </code></pre>