cfdm.Field._docstring_substitutions

Field._docstring_substitutions()[source]

Return the docstring substitutions that apply to methods of the given class.

Text to be replaced is specified as a key in the returned dictionary, with the replacement text defined by the corresponding value.

Special docstring subtitutions, as defined by a class’s _docstring_special_substitutions method, may be used in the replacement text, and will be substituted as ususal.

Replacement text may contain other non-special substitutions.

Note

The values are only checked once for embedded non-special substitutions, so if the embedded substitution itself contains a non-special substitution then the latter will not be replaced. This restriction is to prevent the possibility of infinite recursion.

A key must be either a str or a re.Pattern object.

If a key is a str then the corresponding value must be a string.

If a key is a re.Pattern object then the corresponding value must be a string or a callable, as accepted by the re.Pattern.sub method.

New in version (cfdm): 1.8.7.0

See also

_docstring_special_substitutions, _docstring_package_depth, _docstring_method_exclusions, __docstring_substitutions__, __docstring_package_depth__ __docstring_method_exclusions__

Parameters
cls: class

The class.

Returns
dict

The docstring substitutions. A dictionary key matches text in the docstrings, with a corresponding value its replacement.