Substitution#
- class Substitution[source]#
Substitution docstring placeholders.
A decorator to take a function’s docstring and perform string substitution on it.
This decorator should be robust even if func.__doc__ is None (for example, if -OO was passed to the interpreter)
Usage: construct a docstring.Substitution with a dictionary suitable for performing substitution; then decorate a suitable function with the constructed object. e.g.
sub_author_name = Substitution(author=’Jason’)
@sub_author_name def some_function(x):
“{author} wrote this function”
# note that some_function.__doc__ is now “Jason wrote this function”
- __new__(*args, **kwargs)#
Methods
|
Update self.params with supplied args. |