-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Deprecate NavigationToolbar2._init_toolbar. #17111
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QuLogic
reviewed
Apr 14, 2020
QuLogic
approved these changes
Apr 14, 2020
34f778b
to
3da0637
Compare
2 tasks
rebased |
As argued elsewhere, a customization point which requires third-party libraries to override a private method is awkward from the PoV of documentation and of required API stability. In fact _init_toolbar is not needed as a customization point; third-party libraries can simply override `__init__` and call `super().__init__` as appropriate. Moreover, *requiring* that `_init_toolbar` be overridden is actually overkill, e.g. for `test_backend_bases.py::test_interactive_zoom`: there, the base class NavigationToolbar2 is perfectly suitable -- see change there. In order to let third-parties write code that supports both pre- and post-deprecation versions of mpl, allow them to keep a fully empty `_init_toolbar` (an override is required by earlier versions of mpl) without triggering a deprecation warning.
Rebased to take advantage of the new _deprecate_method_override. |
QuLogic
approved these changes
Apr 29, 2020
tacaswell
approved these changes
Apr 30, 2020
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.
We will need to make an extra effort to get many testers in case there is something subtle broken here.
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As argued elsewhere, a customization point which requires third-party
libraries to override a private method is awkward from the PoV of
documentation and of required API stability. In fact _init_toolbar is
not needed as a customization point; third-party libraries can simply
override
__init__
and callsuper().__init__
as appropriate.Moreover, requiring that
_init_toolbar
be overridden is actuallyoverkill, e.g. for
test_backend_bases.py::test_interactive_zoom
:there, the base class NavigationToolbar2 is perfectly suitable -- see
change there.
In order to let third-parties write code that supports both pre- and
post-deprecation versions of mpl, allow them to keep a fully empty
_init_toolbar
(an override is required by earlier versions of mpl)without triggering a deprecation warning.
Note that git(hub) may show the diff a bit weirdly, but for the GUI backend implementations, this is basically just moving the body of
_init_toolbar
into__init__
(it's just that git instead shows that as the code between__init__
and_init_toolbar
moving down.)PR Summary
PR Checklist