Skip to content

tinker_cookbook.utils.deprecated

tinker_cookbook.utils.deprecated(_func, message, removal_version)

Decorator to mark a function or class as deprecated.

Can be used with or without arguments::

@deprecated def old(): ...

@deprecated(message="Use new_func instead.", removal_version="0.20.0") def old(): ...

When applied to a class, the warning is emitted at instantiation time.

Parameters:

Returns: Any