module documentation

This is a module demonstrating reST code documentation features.

Most part of this documentation is using Python type hinting.

Interface IContact Example of an interface with schemas.
Class DemoClass This is the docstring of this class.
Function demo_consolidated_fields Fields can be condensed into one "consolidated" field. Looks better in plain text.
Function demo_cross_reference The inline markup construct `object` is used to create links to the documentation for other Python objects. 'text' is the text that should be displayed for the link, and 'object' is the name of the Python object that should be linked to.
Function demo_fields_docstring_arguments Fields are used to describe specific properties of a documented object.
Function demo_long_function_and_parameter_names__this_indeed_very_long Long names and annotations should display on several lines when they don't fit in a single line.
Function demo_overload Overload signatures appear without the main signature and with @overload decorator.
Function demo_product_deprecated Undocumented
Function demo_typing_arguments Type documentation can be extracted from standard Python type hints.
Function demo_undocumented Undocumented
Constant LANG This is a constant. See constants for more examples.
Constant lang This is also a constant, but annotated with typing.Final.
Type Alias Parser Type aliases are documented as such and their value is shown just like constants.
Class _PrivateClass This is the docstring of a private class.
def demo_consolidated_fields(a: float, b): (source)

Fields can be condensed into one "consolidated" field. Looks better in plain text.

Parameters
a:floatThe size of the fox (in meters)
bThe weight of the fox (in stones)
Returns
strThe number of foxes
def demo_cross_reference(): (source)

The inline markup construct `object` is used to create links to the documentation for other Python objects. 'text' is the text that should be displayed for the link, and 'object' is the name of the Python object that should be linked to.

If you wish to use the name of the Python object as the text for the link, you can simply write `object` -> object.

def demo_fields_docstring_arguments(m, b=0): (source)

Fields are used to describe specific properties of a documented object.

This function's ":type:" tags are taking advantage of the --process-types.

Parameters
m:numbers.NumberThe slope of the line.
b:numbers.Number, optionalThe y intercept of the line.
Returns
numbers.Numberthe x intercept of the line M{y=m*x+b}.
def demo_long_function_and_parameter_names__this_indeed_very_long(this_is_a_very_long_parameter_name_aahh: str, what__another_super_super_long_name__ho_no: Generator[list[AnyStr] | dict[str, AnyStr], None, None]) -> bool: (source)

Long names and annotations should display on several lines when they don't fit in a single line.

@overload
def demo_overload(s: str) -> str:
@overload
def demo_overload(s: bytes) -> bytes:
(source)

Overload signatures appear without the main signature and with @overload decorator.

Parameters
s:str | bytesSome string or bytes param.
Returns
str | bytesSome string or bytes result.
def demo_product_deprecated(x, y) -> float: (source)

Deprecated since version NEXT: demo_product_deprecated was deprecated in demo NEXT; please use math.prod instead.

Undocumented

def demo_typing_arguments(name: str, size: bytes | None = None) -> bool: (source)

Type documentation can be extracted from standard Python type hints.

Parameters
name:strThe human readable name for something.
size:bytes | NoneHow big the name should be. Leave none if you don't care.
Returns
boolAlways True.
def demo_undocumented(s: str) -> str: (source)

Undocumented

This is a constant. See constants for more examples.

Value
'Fr'

This is also a constant, but annotated with typing.Final.

Value
['Fr', 'En']

Type aliases are documented as such and their value is shown just like constants.

Value
Callable[[str], Tuple[int, bytes, bytes]]