Search notes:
Python: docstring
Some conventions for docstrings include:
The first line should be short and concise, start with a capital letter and end with a period. It should not mention the described class or function name.
The second line should be blank (if more text follows).
See also
The
__annotations__
dunder.
Docstrings in function definitions
The module
doctest
finds code in a
module's
docstrings and executes them, typically for
testing
purposes.
Docstrings are removed with the
-OO
command line option
.
Index