-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Currently the deprecation warning is only shown for kwargs. I think that doing the same for args would be interesting (either by config or by default).
@deprecat(deprecated_args={'a':{'version':'4.0', 'reason': ''}, 'b':{'version':'3.0', 'reason': ''}})
def multiply(a, b, c):
return 42
multiply(1,2,3)
multiply(a=1,b=2,c=3)
Wouldn't it be more consistent to display the deprecation at the first call? The deprecated args have actually been called. Currently the output is
>>> multiply(1,2,3)
42
>>> multiply(a=1,b=2,c=3)
<stdin>:1: DeprecationWarning: Call to deprecated Parameter a. -- Deprecated since v4.0.
<stdin>:1: DeprecationWarning: Call to deprecated Parameter b. -- Deprecated since v3.0.
42
Metadata
Metadata
Assignees
Labels
No labels