title: Dynamically generating a function tree in Python.
body: <p>I want to do is something like this</p>
  
  <pre><code>def mult(x, y):
       return x * y
  
  def add(x, y):
       return x + y
  
  treeFunction = mult(2, add(x, y))
  
  #outputs 10 (2 * ( 2 + 3 ))
  print treeFunction(2, 3)
  </code></pre>
  
  <p>basically, is there a way during run-time to change add()'s return value by multiplying it by some value.</p>