mt.base.deprecated

Utilities to deprecate a function or a module.

Functions

  • deprecated_func(): A decorator to warn the user that the function has been deprecated and will be removed in future.

  • deprecated_class(): A decorator to warn the user that the class has been deprecated and will be removed in future.

mt.base.deprecated.deprecated_func(deprecated_version, suggested_func=None, removed_version=None, docstring_prefix='')

A decorator to warn the user that the function has been deprecated and will be removed in future.

Parameters:
  • deprecated_version (str) – the version since which the function has been deprecated

  • suggested_func (str or list of strings, optional) – the function to be used in replacement of the deprecated function

  • removed_version (str, optional) – the future version from which the deprecated function will be removed

  • docstring_prefix (str) – prefix string to be inserted at the beginning of every new line in the docstring

mt.base.deprecated.deprecated_class(deprecated_version, suggested_class=None, removed_version=None, docstring_prefix='')

A decorator to warn the user that the class has been deprecated and will be removed in future.

Parameters:
  • deprecated_version (str) – the version since which the class has been deprecated

  • suggested_class (str or list of strings, optional) – the class to be used in replacement of the deprecated class

  • removed_version (str, optional) – the future version from which the class will be removed

  • docstring_prefix (str) – prefix string to be inserted at the beginning of every new line in the docstring