{{ message }}
Deprecate NavigationToolbar2._init_toolbar. - #17111
Merged
Merged
Conversation
QuLogic
reviewed
Apr 14, 2020
QuLogic
approved these changes
Apr 14, 2020
anntzer
force-pushed
the
init_toolbar
branch
2 times, most recently
from
April 19, 2020 22:10
34f778b to
3da0637
Compare
2 tasks
Contributor
Author
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.
Contributor
Author
QuLogic
approved these changes
Apr 29, 2020
tacaswell
approved these changes
Apr 30, 2020
tacaswell
left a comment
Member
There was a problem hiding this comment.
We will need to make an extra effort to get many testers in case there is something subtle broken here.
6 tasks
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
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_toolbarbe 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_toolbarinto__init__(it's just that git instead shows that as the code between__init__and_init_toolbarmoving down.)PR Summary
PR Checklist