qiskit-documentation/docs/api/qiskit/0.43/qiskit.utils.deprecate_func...

38 lines
2.0 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: deprecate_func
description: API reference for qiskit.utils.deprecate_func
in_page_toc_min_heading_level: 1
python_api_type: function
python_api_name: qiskit.utils.deprecate_func
---
<span id="qiskit-utils-deprecate-func" />
# qiskit.utils.deprecate\_func
<Function id="qiskit.utils.deprecate_func" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.24/qiskit/utils/deprecation.py" signature="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)">
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** (*str | None*) 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 isnt necessary for property setters, as their docstring is ignored by Python.)
**Returns**
The decorated callable.
**Return type**
Callable
</Function>