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

Charles R Harris charlesr.harris at gmail.com
Sun Aug 3 20:32:07 EDT 2008


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

> On Mon, Aug 4, 2008 at 8:31 AM, Charles R Harris
> <charlesr.harris at 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.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20080803/3fb522a1/attachment.html>


More information about the NumPy-Discussion mailing list