[Numpy-discussion] Why are ufunc docstrings useless?

Anne Archibald peridot.faceted@gmail....
Thu May 8 21:52:08 CDT 2008

2008/5/8 Robert Kern <robert.kern@gmail.com>:
> On Thu, May 8, 2008 at 5:28 PM, Anne Archibald
> <peridot.faceted@gmail.com> wrote:
>> Hi,
>> I frequently use functions like np.add.reduce and np.add.outer, but
>> their docstrings are totally uninformative. Would it be possible to
>> provide proper docstrings for these ufunc methods? They need not be
>> specific to np.add; just an explanation of what arguments to give (for
>> example) reduce() (presumably it takes an axis= argument? what is the
>> default behaviour?) and what it does would help.
> Sure. The place to add them would be in the PyMethodDef ufunc_methods
> array on line 3953 of numpy/core/src/ufuncobject.c. Just extend each
> of the rows with a char* containing the docstring contents. A literal
> "string" will suffice.

Thanks! Done add, reduce, outer, and reduceat. What about __call__?


More information about the Numpy-discussion mailing list