title: Python: partial that takes three arguments
body: <p>I'm trying to learn Python by reading the book <a href="https://www.amazon.co.uk/Data-Science-Scratch-Principles-Python/dp/149190142X" rel="noreferrer">Data Science from Scratch by Joel Grus</a>, and on page 94 they describe how to approximate a derivative of f = x^2 using the following code</p>
  
  <pre><code>def difference_quotient(f, x, h):
      return (f(x + h) - f(x)) / h
  
  def square(x):
      return x * x
  
  def derivative(x):
      return 2 * x
  
  derivative_estimate = partial(difference_quotient, square, h=0.00001)
  
  # plot to show they're basically the same
  import matplotlib.pyplot as plt
  x = range(-10,10)
  plt.title("Actual Derivatives vs. Estimates")
  plt.plot(x, map(derivative, x), 'rx', label='Actual')
  plt.plot(x, map(derivative_estimate, x), 'b+', label='Estimate')
  plt.legend(loc=9)
  plt.show()
  </code></pre>
  
  <p>Everything works fine, but when I change the line <code>derivative_estimate = partial(difference_quotient, square, h=0.00001)</code> to <code>derivative_estimate = partial(difference_quotient, f=square, h=0.00001)</code> (because I think that is clearer to read), then I get the following error</p>
  
  <pre><code>Traceback (most recent call last):
    File "page_93.py", line 37, in &lt;module&gt;
      plt.plot(x, map(derivative_estimate, x), 'b+', label='Estimate')
  TypeError: difference_quotient() got multiple values for keyword argument 'f'
  </code></pre>
  
  <p>What is going on here?</p>