<p dir="auto">There appears to be a regression in <code class="notranslate">scipy.integrate.dblquad</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from scipy.integrate import dblquad
f = lambda y,x,a: a*x*y
dblquad(f, 0, 1, lambda y: 0, lambda y: 1, args=(1,))"><pre class="notranslate"><code class="notranslate">from scipy.integrate import dblquad
f = lambda y,x,a: a*x*y
dblquad(f, 0, 1, lambda y: 0, lambda y: 1, args=(1,))
</code></pre></div>
<p dir="auto">works in 0.17.1, but in 0.18 causes the error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=".../python3.4/site-packages/scipy/integrate/quadpack.py in integrate(self, *args, **kwargs)
    747         ind = -(depth + 1)
    748         fn_range = self.ranges[ind]
--&gt; 749         low, high = fn_range(*args)
    750         fn_opt = self.opts[ind]
    751         opt = dict(fn_opt(*args))

TypeError: &lt;lambda&gt;() takes 1 positional argument but 2 were given"><pre class="notranslate"><code class="notranslate">.../python3.4/site-packages/scipy/integrate/quadpack.py in integrate(self, *args, **kwargs)
    747         ind = -(depth + 1)
    748         fn_range = self.ranges[ind]
--&gt; 749         low, high = fn_range(*args)
    750         fn_opt = self.opts[ind]
    751         opt = dict(fn_opt(*args))

TypeError: &lt;lambda&gt;() takes 1 positional argument but 2 were given
</code></pre></div>
<p dir="auto">Changing the call to</p>
<p dir="auto"><code class="notranslate">dblquad(lambda y,x,a: 1, 0, 1, lambda x,a: 0, lambda x,a: 1,args=(1,))</code></p>
<p dir="auto">does not fix the problem. Version info:</p>
<p dir="auto">Python 3.4.3 (default, Oct 14 2015, 20:28:29)<br>
Type "copyright", "credits" or "license" for more information.</p>
<p dir="auto">IPython 5.0.0 -- An enhanced Interactive Python.</p>
<p dir="auto">In [3]: print( scipy.<strong>version</strong>)<br>
0.18.0</p>
<p dir="auto">Similar to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="114862272" data-permission-text="Title is private" data-url="https://github.com/scipy/scipy/issues/5452" data-hovercard-type="issue" data-hovercard-url="/scipy/scipy/issues/5452/hovercard" href="https://github.com/scipy/scipy/issues/5452">#5452</a>, <code class="notranslate">dblquad</code> fails when called with <code class="notranslate">args</code> because the <code class="notranslate">args</code> get passed to the range function in <code class="notranslate">nquad</code>, even though the range functions are supposed to not have additional arguments (as per the documentation):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; from scipy.integrate import dblquad
&gt;&gt;&gt; g= lambda x: x
&gt;&gt;&gt; h= lambda x: 2 * x
&gt;&gt;&gt; args = 1, 2
&gt;&gt;&gt; func = lambda x0, x1, t0, t1: x0 + x1 + t0 + t1
&gt;&gt;&gt; dblquad(func, 1, 2, g, h, args=args)
TypeError: &lt;lambda&gt;() takes exactly 1 argument (3 given)"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; from scipy.integrate import dblquad
&gt;&gt;&gt; g= lambda x: x
&gt;&gt;&gt; h= lambda x: 2 * x
&gt;&gt;&gt; args = 1, 2
&gt;&gt;&gt; func = lambda x0, x1, t0, t1: x0 + x1 + t0 + t1
&gt;&gt;&gt; dblquad(func, 1, 2, g, h, args=args)
TypeError: &lt;lambda&gt;() takes exactly 1 argument (3 given)
</code></pre></div>
<p dir="auto">This example works in <code class="notranslate">0.16.0</code> (the version I have installed) and I think the changes in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="137406553" data-permission-text="Title is private" data-url="https://github.com/scipy/scipy/issues/5906" data-hovercard-type="pull_request" data-hovercard-url="/scipy/scipy/pull/5906/hovercard" href="https://github.com/scipy/scipy/pull/5906">#5906</a> are to blame.</p>
<p dir="auto">I would suggest fixing this in a way that restores the old <code class="notranslate">dblquad</code> API. <code class="notranslate">tplquad</code> likely has the same issue, but I haven't checked.</p>