title: How to bind arguments to given values in Python functions?
body: <p>I have a number of functions with a combination of positional and keyword arguments, and I would like to bind one of their arguments to a given value (which is known only after the function definition). Is there a general way of doing that?</p>
  
  <p>My first attempt was:</p>
  
  <pre><code>def f(a,b,c): print a,b,c
  
  def _bind(f, a): return lambda b,c: f(a,b,c)
  
  bound_f = bind(f, 1)
  </code></pre>
  
  <p>However, for this I need to know the exact args passed to <code>f</code>, and cannot use a single function to bind all the functions I'm interested in (since they have different argument lists).</p>