From 08a07a714dd635ca8e747e1db5affaf62ee6e1ba Mon Sep 17 00:00:00 2001 From: Eric Arellano Date: Mon, 20 Feb 2023 11:32:30 -0600 Subject: [PATCH] Clarify how to handle pending deprecations --- qiskit/utils/deprecation.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qiskit/utils/deprecation.py b/qiskit/utils/deprecation.py index 3a5fda51284d..cde8112318cb 100644 --- a/qiskit/utils/deprecation.py +++ b/qiskit/utils/deprecation.py @@ -29,7 +29,9 @@ def deprecate_arguments( kwarg_map: A dictionary of the old argument name to the new name. category: Usually either DeprecationWarning or PendingDeprecationWarning. since: The version the deprecation started at. Only Optional for backwards - compatibility - this should always be set. + compatibility - this should always be set. 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. Returns: Callable: The decorated callable. @@ -63,7 +65,9 @@ def deprecate_function( stacklevel: The warning stacklevel to use, defaults to 2. category: Usually either DeprecationWarning or PendingDeprecationWarning. since: The version the deprecation started at. Only Optional for backwards - compatibility - this should always be set. + compatibility - this should always be set. 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. Returns: Callable: The decorated, deprecated callable.