classification
Title: Create a @deprecated decorator (annotation)
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.11
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Leonardofreua
Priority: normal Keywords:

Created on 2021-07-21 19:07 by Leonardofreua, last changed 2021-07-21 19:07 by Leonardofreua.

Messages (1)
msg397958 - (view) Author: Leonardo Freua (Leonardofreua) * Date: 2021-07-21 19:07
Would it be interesting to create a @deprecated decorator to avoid adding warnings.warn("deprecation message", DeprecationWarning, stacklevel=2) in methods body?

Using the decorator approach to indicate depreciation would make the methods cleaner (leaving only their responsibilities in the body) and would be easier to identify, as the cue would be close to the method signature and not mixed with the logic inside the body.

If everyone agrees, I could submit a PR (as a draft) for us to evaluate this functionality.
History
Date User Action Args
2021-07-21 19:07:38Leonardofreuacreate