Skip to content

Commit

Permalink
Clarify how to handle pending deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Arellano committed Feb 23, 2023
1 parent a43e4a1 commit 08a07a7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions qiskit/utils/deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 08a07a7

Please sign in to comment.