[Numpy-svn] [numpy/numpy] 2241e6: ENH: Allow unnamed return values in Returns sectio...

GitHub noreply at github.com
Sat Jun 29 06:29:38 EDT 2013


  Branch: refs/heads/master
  Home:   https://github.com/numpy/numpy
  Commit: 2241e6c363da15403a45640382ffd4c6033f246b
      https://github.com/numpy/numpy/commit/2241e6c363da15403a45640382ffd4c6033f246b
  Author: Rob Ruana <rob at relentlessidiot.com>
  Date:   2013-06-24 (Mon, 24 Jun 2013)

  Changed paths:
    M doc/HOWTO_DOCUMENT.rst.txt
    M doc/example.py
    M doc/sphinxext/numpydoc/docscrape.py
    M doc/sphinxext/numpydoc/docscrape_sphinx.py
    M doc/sphinxext/numpydoc/tests/test_docscrape.py

  Log Message:
  -----------
  ENH: Allow unnamed return values in Returns section of doc string

Developers usually only need the type of a return value
followed by a brief description. However, in some cases
providing a name for a return value can make the documentation
clearer. This enhancement changes the format of the Returns
section such that the type is required, and the name is
optional:

    Returns
    -------
    int
  Description of anonymous integer return value.
    x : str
  Description of string return value named `x`.

With this change, if a colon is not present, then the entire
line is interpreted as the return type. In all other cases,
the Returns section is interpreted according to the current
rules.

Consistent with the current format, if a colon is present, then
the text to the left of the colon is interpreted as the name;
and the text to the right of the colon is interpreted as the
type. This makes the proposed change backwards compatible with
existing documentation.


  Commit: 1d67e265765c624e77e1fd48a1dfe4f035675f65
      https://github.com/numpy/numpy/commit/1d67e265765c624e77e1fd48a1dfe4f035675f65
  Author: Ralf Gommers <ralf.gommers at googlemail.com>
  Date:   2013-06-29 (Sat, 29 Jun 2013)

  Changed paths:
    M doc/HOWTO_DOCUMENT.rst.txt
    M doc/example.py
    M doc/sphinxext/numpydoc/docscrape.py
    M doc/sphinxext/numpydoc/docscrape_sphinx.py
    M doc/sphinxext/numpydoc/tests/test_docscrape.py

  Log Message:
  -----------
  Merge pull request #3468 from RelentlessIdiot/numpydoc_returns_unnamed

ENH: Allow unnamed return values in Returns section of doc string


Compare: https://github.com/numpy/numpy/compare/069e9b012cb4...1d67e265765c


More information about the Numpy-svn mailing list