[Numpy-discussion] help(xxx) vs print(xxx.__doc__)

David M. Cooke cookedm at physics.mcmaster.ca
Thu Feb 23 18:28:00 EST 2006

"Bill Baxter" <wbaxter at gmail.com> writes:

> Can someone explain why help(numpy.r_) doesn't contain all the information in
> print(numpy.r_.__doc__)?
> Namely you don't get the helpful example showing usage with 'help' that you get
> with '.__doc__'.
> I'd rather be able to use 'help' as the one-stop shop for built-in
> documentation.  It's less typing and just looks nicer.

Huh, odd. Note that in IPython, numpy.r_? and numpy.r_.__doc__ give
the same results.

And I thought I was being clever when I rewrote numpy.r_ :-) Looks
like help() looks at the class __doc__ first, while IPython looks at
the object's __doc__ first.

I've fixed this in svn.

|David M. Cooke                      http://arbutus.physics.mcmaster.ca/dmc/
|cookedm at physics.mcmaster.ca

More information about the NumPy-Discussion mailing list