deprecate
deprecate ¶
deprecate ¶
Can be used to deprecate a function which should not be used anymore.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
until
|
str | None
|
At what version is the old function location deprecated?
Example: |
None
|
warn_msg
|
str | None
|
Provide a specific warning message. Defaults to a generic message. |
None
|
Returns:
| Type | Description |
|---|---|
Callable
|
The wrapped function. |
deprecate_location ¶
deprecate_location(new_path: str, until: str | None = None, warn_msg: str | None = None) -> Callable
Can be used as a wrapper when moving a function to indicate that the current location will be deprecated.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
new_path
|
str
|
import-path to the new function.
Example: |
required |
until
|
optional
|
At what version is the old function location deprecated?
Example: |
None
|
warn_msg
|
optional
|
A specific warning message to use. |
None
|
Returns:
| Type | Description |
|---|---|
callable
|
The wrapped function. |
get_deprecations_from ¶
Returns the deprecation decorators remaining after the specified version.
Note
Deprecations are only included if the module they live in is loaded.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
version
|
str | None
|
include deprecations at and before this version.
Example: |
None
|
Yields:
| Type | Description |
|---|---|
str
|
The path to the deprecated function. |