warn_deprecated - Tinker Documentation
tinker_cookbook.utils.warn_deprecated
tinker_cookbook.utils.warn_deprecated( name, removal_version, message, stacklevel)
Emit a DeprecationWarning for a deprecated feature.
If the current package version is at or past removal_version, raises a RuntimeError instead so that stale deprecated code paths are not silently used after their intended removal date.
Parameters:
- name ( str) – Short identifier for the deprecated feature (e.g. function name, parameter name).
- removal_version ( str | None) – The version in which this feature will be removed. When the running version reaches this value the warning becomes a hard error. Pass
Noneto warn without a scheduled removal. - message ( str) – Additional guidance, typically a migration path such as "Use X instead."
- stacklevel ( int) – Passed through to
warnings.warn. The default of 2 points at the caller of the function that callswarn_deprecated.
Returns: None