-
Notifications
You must be signed in to change notification settings - Fork 31
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
Implement DeprecatedVariable for deprecating module level variables #35
base: master
Are you sure you want to change the base?
Conversation
+ Add class `DeprecatedVariable` * Abstract warning check into `_get_warning_class()` * Abstract warning raising into `_warn_user()` * Abstract docstring wrapping into `_wrap_doctring()` + Implement tests for `DeprecatedVariable` * Update README to mention `DeprecatedVariable`
Codecov Report
@@ Coverage Diff @@
## master #35 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 1 1
Lines 83 110 +27
Branches 16 20 +4
=====================================
+ Hits 83 110 +27
Continue to review full report at Codecov.
|
Cool! Thanks for writing this up! I have a few things to think about and will try to get you a review for this in the next few days. |
deprecated_in, removed_in, current_version | ||
) | ||
|
||
class TemporaryClass(obj.__class__): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to blow up even for things like SOME_THING_TO_BE_DEPRECATED = True
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I don't think that using a wrapper object on the object-to-be-deprecated is a promising way to handle this personally. You need to do stuff to the module object instead).
Don't think this is the right approach personally, but Twisted, which is the best implementor of this functionality that I'm aware of, is as usual a decent place to use as a cheat sheet for this functionality IMHO. |
DeprecatedVariable
_get_warning_class()
_warn_user()
_wrap_doctring()
DeprecatedVariable
DeprecatedVariable