Skip to content

Commit 14cdc61

Browse files
committed
Document return value
1 parent 248b99e commit 14cdc61

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

scanpydoc/elegant_typehints/__init__.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Format typehints elegantly and and fix autimatically created links.
22
33
The Sphinx extension :mod:`sphinx_autodoc_typehints` adds type annotations to functions.
4-
This extension modifies the created type annotations in two ways:
4+
This extension modifies the created type annotations in four ways:
55
66
#. It formats the annotations more simply and in line with e.g. :mod:`numpy`.
77
#. It defines a configuration value ``qualname_overrides`` for ``conf.py``
@@ -22,6 +22,22 @@
2222
this part of the functionality will no longer be necessary.
2323
#. The config value ``annotate_defaults`` (default: :data:`True`) controls if rST code
2424
like ``(default: `42`)`` is added after the type.
25+
#. Type annotations for :class:`tuple` return types are added::
26+
27+
def x() -> Tuple[int, float]:
28+
\"""
29+
Returns:
30+
a: An integer
31+
b: A floating point number
32+
\"""
33+
34+
will render as:
35+
36+
:Returns: a : :class:`int`
37+
An integer
38+
b : :class:`float`
39+
A floating point number
40+
2541
2642
.. _sphinx issue 4826: https://github.com/sphinx-doc/sphinx/issues/4826
2743
.. _sphinx-autodoc-typehints issue 38: https://github.com/agronholm/sphinx-autodoc-typehints/issues/38

0 commit comments

Comments
 (0)