version
Constants storing the version numbers for major changes to the codebase.
Functions:
Name | Description |
---|---|
deprecated |
Mark the version where a feature was deprecated, by adding dynamically a "Deprecated" section to its docstring. |
versionadded |
Mark the version where a feature was added, by adding dynamically a "Version Added" section to its docstring. |
versionchanged |
Mark the version where a feature was changed, by adding dynamically a "Version Changed" section to its docstring. |
deprecated
¶
deprecated(
version: str,
reason: str = "",
version_for_removal: str | None = None,
) -> Callable[[T], T]
Mark the version where a feature was deprecated, by adding dynamically a "Deprecated" section to its docstring.
This "Deprecated" section will render correctly in the HTML documentation generated by MkDocs.
This can be composed with other version decorators, including deprecated
,
versionchanged
, and versionadded
.
When composed, decorators closer to the feature definition will appear first in the docstring.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The version number in which the feature was deprecated. |
required |
|
str | None
|
The version number in which the feature will be removed. If |
None
|
|
str
|
A brief explanation of the deprecation of the feature. |
''
|
Returns:
Type | Description |
---|---|
Callable[[T], T]
|
Decorator that adds a "Deprecated" section to the docstring of the decorated feature. |
versionadded
¶
Mark the version where a feature was added, by adding dynamically a "Version Added" section to its docstring.
This "Version Added" section will render correctly in the HTML documentation generated by MkDocs.
This can be composed with other version decorators, including deprecated
,
versionchanged
, and versionadded
.
When composed, decorators closer to the feature definition will appear first in the docstring.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The version number in which the feature was added. |
required |
|
str
|
A brief explanation of the feature or change. |
''
|
Returns:
Type | Description |
---|---|
Callable[[T], T]
|
Decorator that adds a "Version Added" section to the docstring of the decorated feature. |
versionchanged
¶
Mark the version where a feature was changed, by adding dynamically a "Version Changed" section to its docstring.
This "Version Changed" section will render correctly in the HTML documentation generated by MkDocs.
This can be composed with other version decorators, including deprecated
,
versionchanged
, and versionadded
.
When composed, decorators closer to the feature definition will appear first in the docstring.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The version number in which the feature was changed. |
required |
|
str
|
A brief explanation of the feature or change. |
''
|
Returns:
Type | Description |
---|---|
Callable[[T], T]
|
Decorator that adds a "Version Changed" section to the docstring of the decorated feature. |