[Numpy-discussion] Toward a numpy build with warning: handling unused variable

Charles R Harris charlesr.harris@gmail....
Sun Aug 3 19:32:07 CDT 2008

On Sun, Aug 3, 2008 at 6:39 PM, David Cournapeau <cournape@gmail.com> wrote:

> On Mon, Aug 4, 2008 at 8:31 AM, Charles R Harris
> <charlesr.harris@gmail.com> wrote:
> >
> > But how many methods do arrays and types have? As many as 1500?
> With autogenerated code, it is not difficult to imagine so many warnings.
> >I think it
> > is a bad idea to work around these sort of things. If self is needed, it
> > belongs there. If not, it should be removed.
> But that's the point: they can't be removed. The python C api force
> you for any function to have two arguments:
> static PyObject *
> spam_system(PyObject *self, PyObject *args)
> Many warnings are "warning: unused argument unused", or "warning:
> dummy argument unused" :) You can't remove them form the argument
> list.

There is self and args, filter them out. If the arguments have other names,
rename them.

> > If the warnings are too
> > numerous, filter them.
> If you filter them, what's the point of keeping them ?

Because the compiler's inadequate determination of errors is driving the
coding. That seems wrong way around. Maybe these variables can be notated
somehow, i.e, __unused__(arg), which would at least document intent.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080803/3fb522a1/attachment.html 

More information about the Numpy-discussion mailing list