momotor.shared.doc
¶
Documentation helpers
Class documentation¶
- momotor.shared.doc.annotate_docstring(*args, **kwargs)¶
Decorator to help write better docstrings.
The arguments of the decorator are applied using
str.format()
to the __doc__ of the class or method decorated.Example:
logger = getLogger('some.logger') @annotate_docstring(logger=logger) class SomeClass: """ This class does some logging on the "{logger.name}" logger """
In the example above, the docstring will read:
This class does some logging on the "some.logger" logger
- Parameters:
args – the arguments for
str.format()
kwargs – the keyword arguments for
str.format()
- Returns:
the decorated object with annotated doc string