When I apply numpy.vectorize() to a function, documentation tools behave 
inconsistently with regard to the new, vectorized function. The 
function's __doc__ attribute does contain the docstring of the original 
function as expected, but the built-in help() command displays the 
documentation of the numpy.vectorize class, and sphinx-autodoc fails to 
display the function at all. Is there a way to get sphinx-autodoc and 
the built-in help() command to display the docstring of the function and 
not something else?

For instance:

>>> import numpy as np
>>> def myfunc(x):
...     "Square x"
...     return x**2
...
>>> myfunc=np.vectorize(myfunc)
>>> print myfunc.__doc__
Square x
>>> help(myfunc)
(displays documentation of np.vectorize)




_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to