[Numpy-discussion] Docstring standards for NumPy and SciPy

Christian Marquardt christian at marquardt.sc
Wed Jan 10 19:13:54 EST 2007

On Wed, 2007-01-10 at 17:53 -0600, Robert Kern wrote:

> How are you viewing the docstrings that wouldn't associate the docstring with
> the function?

   print <function>.__doc__

Like so:

  Python 2.4 (#1, Mar 22 2005, 21:42:42)
  [GCC 3.3.5 20050117 (prerelease) (SUSE Linux)] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  >>> def squared(x):
  ...    """My docstring without function signature."""
  ...    return x*x
  >>> print squared.__doc__
  My docstring without function signature.

Sorry, I wasn't aware that help() prints the signature; I just don't use
it very often... I guess you have a point there.


More information about the NumPy-Discussion mailing list