title: python SciPy error brentq
body: <p>I'm trying to find the roots of a function</p>
  
  <pre><code>from scipy.optimize import brentq
  import matplotlib.pyplot as plt
  from numpy.polynomial import Polynomial,Legendre
  def f():
      return Legendre.basis(3).linspace()
  
  brentq(f,1,2)
  </code></pre>
  
  <p>but i keep getting the error</p>
  
  <pre><code>TypeError: f() takes 0 positional arguments but 1 was given
  </code></pre>
  
  <p>I have no idea whats wrong with it since as far as I can tell, the format of brentq is correct.</p>