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

MNT: Implement a @deprecated decorator #669

Open
4 tasks
Gui-FernandesBR opened this issue Aug 19, 2024 · 2 comments
Open
4 tasks

MNT: Implement a @deprecated decorator #669

Gui-FernandesBR opened this issue Aug 19, 2024 · 2 comments
Labels
Good first issue Good for newcomers

Comments

@Gui-FernandesBR
Copy link
Member

Gui-FernandesBR commented Aug 19, 2024

The @deprecated decorator is used to mark functions or methods as deprecated, indicating that they will be removed in future versions. This helps in managing deprecations and informing users of the codebase about outdated functionalities.
This could help us to organize the code and manage deprecations.

Basic Implementation Steps:

  • Create a decorator function named deprecated.
  • The decorator should issue a warning when the decorated function is called, indicating that it is deprecated.
  • Include a message or version information in the warning to provide more context.
  • Search in the code any deprecation messages and use the decorator you created.

OBS.: Please be aware of 2 different status we may have:

  • 1: The method is already deprecated.
  • 2: The method is set to be deprecated in a future version (this happens when we want to deprecate something, but we are obligated to give users some time ahead).
@LUCKIN13
Copy link
Contributor

Just wanted to inform that this feature has been added to python 3.13.
More info here: https://peps.python.org/pep-0702/

@Gui-FernandesBR
Copy link
Member Author

Just wanted to inform that this feature has been added to python 3.13. More info here: https://peps.python.org/pep-0702/

Thank you!

It will take us 4 years from now until we are finally able to drop support for python 3.12, therefore, I see this issue with less priority, but if someone wants to implement a "brute force" version of the deprecator, that would also be welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good first issue Good for newcomers
Projects
Status: Backlog
Development

No branches or pull requests

2 participants