You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a few cases where deprecated argument data types get normalized. Currently, we end up duplicating the code to detect if it's a bad data type so that we can a) issue the warning via @deprecate_arg and b) normalize the data inside the body of the function. See #9897 (comment) for an example.
It would be useful if we could have predicate also normalize the data. I'm thinking we have it update the *args and **kwargs passed to the original function, which we already have precedent of doing with new_alias:
We probably want predicate to have the return type of bool | tuple[bool, Any]. That is, you can still simply return a bool if it's normalized or not. Or, you can return the bool + the normalized value.
The text was updated successfully, but these errors were encountered:
There are a few cases where deprecated argument data types get normalized. Currently, we end up duplicating the code to detect if it's a bad data type so that we can a) issue the warning via
@deprecate_arg
and b) normalize the data inside the body of the function. See #9897 (comment) for an example.It would be useful if we could have
predicate
also normalize the data. I'm thinking we have it update the*args
and**kwargs
passed to the original function, which we already have precedent of doing withnew_alias
:https://github.com/Qiskit/qiskit-terra/blob/751fa46947aa1cc581b0fc25673236e396397b0f/qiskit/utils/deprecation.py#L294-L295
We probably want
predicate
to have the return type ofbool | tuple[bool, Any]
. That is, you can still simply return a bool if it's normalized or not. Or, you can return the bool + the normalized value.The text was updated successfully, but these errors were encountered: