API documentation
Using Sphinx’s sphinx.ext.autodoc
plugin, it is possible to auto-generate documentation of a Python module.
Tip
Avoid having in-function-signature type annotations with autodoc, by setting the following options:
# -- Options for autodoc ----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#configuration
# Automatically extract typehints when specified and place them in
# descriptions of the relevant function/method.
autodoc_typehints = "description"
# To avoid generating type ints for undocuments parameters and return values
autodoc_typehints_description_target = "documented"
# Don't show class signature with the class' name.
autodoc_class_signature = "separated"
This is a demo module included in the docs in order to exercise autodoc.
- furo._demo_module.show_warning(message, category, filename, lineno, file=None, line=None)
Show a warning to the end user.
warnings.showwarning = show_warning
- class furo._demo_module.RandomNumberGenerator(*, seed=4)
A random number generator.
- Parameters:
seed (int)
- property seed: int
Get seed for random number generation.
Added in version 1.0.
Changed in version 1.1: Use
random
to create the seed.Deprecated since version 1.2:
random
raises security concerns.Removed in version 1.3:
random
replaced with a random number.See also
- furo._demo_module.annoying_function_name_length_aa(one, two)
Add two numbers as strings.
Because I needed a placeholder function.
- furo._demo_module.annoying_function_name_length_aaa(one, two)
Add two numbers as strings.
Because I needed a placeholder function.
C inline signature
This works my_type
, but I would like to point
to a pointer of the type (my_type*).