English
Languages
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

qiskit.utils.deprecate_func

deprecate_func(*, since, additional_msg=None, pending=False, package_name='qiskit-terra', removal_timeline='no earlier than 3 months after the release date', is_property=False)[source]

Decorator to indicate a function has been deprecated.

It should be placed beneath other decorators like @staticmethod and property decorators.

When deprecating a class, set this decorator on its __init__ function.

Parameters
  • since (str) – The version the deprecation started at. If the deprecation is pending, set the version to when that started; but later, when switching from pending to deprecated, update since to the new version.

  • additional_msg (Optional[str]) – Put here any additional information, such as what to use instead. For example, “Instead, use the function new_func from the module <my_module>.<my_submodule>, which is similar but uses GPU acceleration.”

  • pending (bool) – Set to True if the deprecation is still pending.

  • package_name (str) – The PyPI package name, e.g. “qiskit-nature”.

  • removal_timeline (str) – How soon can this deprecation be removed? Expects a value like “no sooner than 6 months after the latest release” or “in release 9.99”.

  • is_property (bool) – If the deprecated function is a @property, set this to True so that the generated message correctly describes it as such. (This isn’t necessary for property setters, as their docstring is ignored by Python.)

Returns

The decorated callable.

Return type

Callable