Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate arguments #57

Open
dyollb opened this issue Jun 24, 2022 · 3 comments
Open

Deprecate arguments #57

dyollb opened this issue Jun 24, 2022 · 3 comments

Comments

@dyollb
Copy link

dyollb commented Jun 24, 2022

This is a feature idea, not a bug report.

It would be great if deprecated could warn about deprecated arguments, e.g. like

@deprecated_arg(name="old_arg_name", since="1.2", version=mypackage.__version__, reason="'old_arg_name' is not consistent with some reference")
def my_function(old_arg_name, other_args):
    pass

which would yield a message like:

"my_function" called with deprecated argument "old_arg_name"

Optionally with a new name hint, so

@deprecated_arg(name="old_arg_name", new_name="new_arg_name", since="1.2", version=mypackage.__version__)
def my_function(old_arg_name, other_args):
    pass

which would yield a message like:

"my_function" called with deprecated argument "old_arg_name". Please use "new_arg_name"

@kc9jud
Copy link

kc9jud commented Jun 30, 2022

See also #5 and #8.

@mjhajharia
Copy link

mjhajharia commented Sep 17, 2022

i think the maintainer has been inactive for a while so i made a fork that supports arg deprecation https://deprecat.readthedocs.io/en/latest/source/introduction.html#additional-features

repo - https://github.com/mjhajharia/deprecat

docs - https://deprecat.readthedocs.io/en/latest/

@tantale
Copy link
Collaborator

tantale commented May 27, 2023

Parameter-level depreciation is currently being developed. Stay tune.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants