plaid.utils.deprecation

Implementation of deprecation utilities.

Attributes

Functions

deprecated(reason[, version, removal])

Decorator to mark a function, method, or class as deprecated.

deprecated_argument(old_arg, new_arg[, converter, ...])

Decorator to mark a function argument as deprecated and redirect it to a new argument.

Module Contents

deprecated_builtin = None[source]
deprecated(reason: str, version: str | packaging.version.Version | None = None, removal: str | packaging.version.Version | None = None)[source]

Decorator to mark a function, method, or class as deprecated.

Uses built-in warnings.deprecated when running on Python 3.13+, otherwise falls back to a custom warning wrapper.

Parameters:
  • reason (str) – Explanation and suggested replacement.

  • version (Union[str,Version], optional) – Version since deprecation.

  • removal (Union[str,Version], optional) – Planned removal version.

deprecated_argument(old_arg: str, new_arg: str, converter=lambda x: ..., version: str | packaging.version.Version | None = None, removal: str | packaging.version.Version | None = None)[source]

Decorator to mark a function argument as deprecated and redirect it to a new argument.

Parameters:
  • old_arg (str) – Name of the old argument.

  • new_arg (str) – Name of the new argument.

  • converter (callable) – Function to convert the old value into the new format.

  • version (Union[str,Version], optional) – Version since deprecation.

  • removal (Union[str,Version], optional) – Planned removal version.