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
Here I would like to discuss the possibility to extend the functionality of this package to notice about forthcoming API changes and the like.
In many cases functions/classes/methods (you name it) are not deprecated but a change in the API will take place. So it would be useful to warn the user about forthcoming changes with a special decorator.
We used this in the past in our package but would like to see it added here, where it belongs (IMHO). Please have a look at possible use cases here.
The current code would naturally need quite bit of lifting to adapt it to this packages style.
Thoughts?
The text was updated successfully, but these errors were encountered:
I would be fine adding support for FutureWarning when current_version < deprecated_in. That part should be fairly easy on its own, just going from our two-state check between deprecated and removed to looking at the version against the three states of future, deprecated, and removed.
Getting into looking at the caller's kwargs and figuring out types and stuff is probably further than I think this decorator should go as a general purpose library. What if there was some parameter to deprecated that was a callable that received the caller's *args, **kwargs and did that determination itself? For example, this is just pseudo-code, but what if the details parameter took that callable argument and generated the details from it?
defarg_checker(*args, **kwargs):
if"x"inkwargs":
ifisinstance(kwargs["x"], int):
return"x will become a str in 0.5"@deprecated(deprecated_in="0.5", current_version="0.2",details=arg_checker)deffunc(a, b, x=None, y=None):
...
@briancurtin Thank you for the comment. Especially the idea with the 'arg_checker' is charming. This will keep the flexibility at the user side and the simple code in the package.
Here I would like to discuss the possibility to extend the functionality of this package to notice about forthcoming API changes and the like.
In many cases functions/classes/methods (you name it) are not deprecated but a change in the API will take place. So it would be useful to warn the user about forthcoming changes with a special decorator.
We used this in the past in our package but would like to see it added here, where it belongs (IMHO). Please have a look at possible use cases here.
The current code would naturally need quite bit of lifting to adapt it to this packages style.
Thoughts?
The text was updated successfully, but these errors were encountered: