from dascore.utils.deprecate import deprecate
# Deprecate function so it issues a warning when used.
@deprecate(info="This function is deprecated.")
def foo():
pass
deprecate
deprecate(
info: str = ““,
since: str | None[str, None] = None,
removed_in: str | None[str, None] = None,
)-> ‘Callable[[F], F]’
Mark a function as deprecated.
- Raises a runtime warning when called.
- Annotates the function so editors/type checkers show deprecation.
- Augments the docstring.
Parameters
Parameter | Description |
---|---|
info |
Short message shown in warnings and editor hints. It is useful to specify what should be used in place of the deprecated function. |
since | Version/date when deprecation started (for the message only). |
removed_in | Version/date when the function will be removed (for the message only). |