# [Scipy-tickets] [SciPy] #1519: "quad" and "quadrature" behave differently when args is a single variable

SciPy Trac scipy-tickets@scipy....
Thu Sep 15 04:57:57 CDT 2011

```#1519: "quad" and "quadrature" behave differently when args is a single variable
--------------------------------------+-------------------------------------
Reporter:  azrael                    |       Owner:  somebody
Type:  defect                    |      Status:  new
Priority:  normal                    |   Milestone:  Unscheduled
Component:  scipy.integrate           |     Version:  0.7.2
--------------------------------------+-------------------------------------
As far as I understand
quadrature] should be interchangeable, atleast syntax-wise. Strangely it
does seem they are not:

{{{
from scipy.integrate import quad as q
#from scipy.integrate import quadrature as q

def myfunc(x, y):
return x + y

def integr1(y):
return q(myfunc, 0, 1, args=(y))[0]

def integr2(y):
return q(myfunc, 0, 1, args=(y,))[0]

print integr1(10), integr2(10)
}}}

will produce the right result, while switching to quadrature in the first

{{{
Traceback (most recent call last):
File "./test.py", line 38, in <module>
print integr2(10)
File "./test.py", line 36, in integr2
return q(myfunc, 0, 1, args=(y))[0]
newval = fixed_quad(vfunc, a, b, (), n)[0]
return (b-a)/2.0*sum(w*func(y,*args),0), None
line 77, in vfunc
return func(x, *args)
TypeError: myfunc() argument after * must be a sequence, not int
}}}

This was found because the wrongly used tuple in integr1() was the first

1. Shouldn't both integrators accept the same syntax? Even if that means
the acceptance for a single variable instead of a one-element-tuple in