Merged
Conversation
ksunden
reviewed
Aug 31, 2023
Comment on lines
+31
to
+34
| @lines.Line2D.axes.setter | ||
| def axes(self, new_axes): | ||
| self.text.axes = new_axes | ||
| lines.Line2D.axes.fset(self, new_axes) |
Member
There was a problem hiding this comment.
This is an unusual enough pattern, that it probably warrants a comment explaining it. (Just a simple # Override the axes property setter and potentially # Call the superclass property setter)
It works, and is probably about the best you can do to override the property setter/call the super-class version of the property setter.
Some things I thought about which would have made some sense to me, but don't seem to work in this context:
- using
@MyLine.axes.setter(MyLineis not available at class instantiation time)- I worried a bit about the setter accidentally overriding the parent classes setter, but that does not happen)
- using
super().axes.fset(new_axes)(super().axesresoves to the return of the getter, not the property descriptor)
Member
|
Other than adding a comment explaining the unusual property setter override, LGTM |
`set_axes` was dropped from `Artist` a long time ago, so the version in the subclass did nothing.
oscargus
approved these changes
Aug 31, 2023
ksunden
approved these changes
Aug 31, 2023
meeseeksmachine
pushed a commit
to meeseeksmachine/matplotlib
that referenced
this pull request
Aug 31, 2023
ksunden
added a commit
that referenced
this pull request
Aug 31, 2023
…657-on-v3.8.x Backport PR #26657 on branch v3.8.x (DOC: Fix some small issues)
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.
PR summary
PR checklist