[Numpy-discussion] Current ufunc signatures for review

Charles R Harris charlesr.harris@gmail....
Sun May 25 13:55:52 CDT 2008


On Sun, May 25, 2008 at 12:42 PM, Pauli Virtanen <pav@iki.fi> wrote:

> su, 2008-05-25 kello 12:12 -0600, Charles R Harris kirjoitti:
> [clip]
> > 1) Help strings on ufuncs don't work. This seems to be a problem with the
> help function, as
> >    printing the relevant __doc__ works fine. The docstrings are currently
> defined in
> >    code_generators/generate_umath.py and add_newdoc doesn't seem to work
> for them.
>
> Yes, this is a problem with the help function. In pydoc.py in the Python
> standard library:
>
> def doc(...):
>    ...
>        if not (inspect.ismodule(object) or
>                inspect.isclass(object) or
>                inspect.isroutine(object) or
>                inspect.isgetsetdescriptor(object) or
>                inspect.ismemberdescriptor(object) or
>                isinstance(object, property)):
>            # If the passed object is a piece of data or an instance,
>            # document its available methods instead of its value.
>            object = type(object)
>        ...
>
> Is it possible to make one of the above conditions True for ufuncs?
>

I don't see why not, we could have numpy.doc. Hmm, it should probably be
changed in ipython also. Something like

In [5]: isinstance(sin, numpy.ufunc)
Out[5]: True

might do the trick.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080525/9f7ee174/attachment.html 


More information about the Numpy-discussion mailing list