File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
scanpydoc/elegant_typehints Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 1
1
"""Format typehints elegantly and and fix autimatically created links.
2
2
3
3
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:
5
5
6
6
#. It formats the annotations more simply and in line with e.g. :mod:`numpy`.
7
7
#. It defines a configuration value ``qualname_overrides`` for ``conf.py``
22
22
this part of the functionality will no longer be necessary.
23
23
#. The config value ``annotate_defaults`` (default: :data:`True`) controls if rST code
24
24
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
+
25
41
26
42
.. _sphinx issue 4826: https://github.com/sphinx-doc/sphinx/issues/4826
27
43
.. _sphinx-autodoc-typehints issue 38: https://github.com/agronholm/sphinx-autodoc-typehints/issues/38
You can’t perform that action at this time.
0 commit comments