Demo

demo(a, b=0.0, c='', d=' ', e='hello world', f=(), g=Decimal('12.34'), h=1234, i=None, j=None, k=None, l='', m='\t', n=...)[source]
Parameters
  • a (Any) – No default.

  • b (float) – A float. Default 0.0.

  • c (str) – An empty string. Default ''.

  • d (str) – A space (or a smiley face?). Default '␣'.

  • e (str) – A string. Default 'hello world'.

  • f (Tuple) – A Tuple. Default ().

  • g (Decimal) – A Decimal. Default Decimal('12.34').

  • h (int) – An int. Default 1234.

  • i (Optional[List[str]]) – Default None. Default None.

  • j (Optional[List[str]]) – Overridden default. Default [].

  • k (Optional[List[str]]) – Suppressed default.

  • l (str) – This is a really long description. It spans multiple lines. The quick brown fox jumps over the lazy dog. The default value should be added at the end regardless. Default ''.

  • m (str) – Tab. Default '\t'.

  • n (Any) – This argument’s default value is undefined.

The description for d lacked a fullstop at the end, but one was added automatically.

The default value of n was Ellipsis, but it wasn’t shown.


The above example was created from the following Python code:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# noqa: D100

# stdlib
from decimal import Decimal  # pragma: no cover
from typing import Any, List, Optional, Tuple  # pragma: no cover

__all__ = ["demo"]  # pragma: no cover


def demo(
        a: Any,
        b: float = 0.0,
        c: str = '',
        d: str = ' ',
        e: str = "hello world",
        f: Tuple = (),
        g: Decimal = Decimal("12.34"),
        h: int = 1234,
        i: Optional[List[str]] = None,
        j: Optional[List[str]] = None,
        k: Optional[List[str]] = None,
        l: str = '',
        m: str = '\t',
        n: Any = ...,
        ):  # pragma: no cover
    """

    :param a: No default.
    :param b: A float.
    :param c: An empty string.
    :param d: A space (or a smiley face?)
    :param e: A string.
    :param f: A Tuple.
    :param g: A Decimal.
    :param h: An int.
    :param i: Default None.
    :param j: Overridden default.
    :default j: ``[]``
    :param k: Suppressed default.
    :no-default k:
    :param l: This is a really long description.
        It spans multiple lines.
        The quick brown fox jumps over the lazy dog.
        The default value should be added at the end regardless.
    :param m: Tab.
    :param n: This argument's default value is undefined.

    The description for ``d`` lacked a fullstop at the end, but one was added automatically.

    The default value of ``n`` was :py:obj:`Ellipsis`, but it wasn't shown.
    """

The PEP 484 type hints were added by sphinx-autodoc-typehints.