-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
deprecation of validCap, validJoin makes pydoc spam out many, many warnings #19080
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
Comments
Interesting. I don't see a way around the fact that if we're going to emit a UserWarning on class attribute access, then modules that systematically import/inspect class attributes are going to trigger a computer-generated amount of copies of this warning. Even when building our docs, in order to prevent this, there is a special filter ignoring any MatplotlibDeprecationWarnings coming from That said, to me this is clearly a case of deprecation warnings causing more annoyance than they do good, since people inspecting the class using standard tools should not be spammed by us. This issue may be the first concrete argument for why we should make MatplotlibDeprecationWarning an actual DeprecationWarning instead of a UserWarning. The filter that was added in Python ~3.2 (and amended most recently in https://www.python.org/dev/peps/pep-0565/, I think?) prevents this issue if MatplotlibDeprecationWarning is a subclass of DeprecationWarning, as the point of those changes was exactly to hide deprecation warnings from "end users" like someone running |
I see three reasonable paths for resolution:
|
Avoiding the larger point, can we deprecate on at least write only? |
Technically, it is sufficient to document the deprecation in API changes. We don't have to issue runtime warnings. Sure, a runtime warning is more discoverable, but if it's doing more harm than good we can go without it. |
I can definitely push this, although I'm not sure it's worth the effort, since in this particular case I'm....frankly not sure who we're targeting with that message.
I'll bring this up as a quick point in today's call if it happens, that might be the way to go. |
Cross ref #18817 |
|
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help! |
These deprecations were removed in 3.6, so I guess there's nothing to worry about here any more. |
Bug report
Bug summary
pydoc matplotlib.patches
emits many warnings about the deprecation ofvalidJoin
andvalidCap
. attn @brunobeltran, I guess.Code for reproduction
Actual outcome
Per the above.
Expected outcome
No warning
Matplotlib version
print(matplotlib.get_backend())
):I guess a solution would be to add a check in
_deprecated_property.__get__
to silence the warning ifsys.argv[0] == pydoc.__file__
.The text was updated successfully, but these errors were encountered: