-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOC: Fix some small issues #26657
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
DOC: Fix some small issues #26657
Conversation
@lines.Line2D.axes.setter | ||
def axes(self, new_axes): | ||
self.text.axes = new_axes | ||
lines.Line2D.axes.fset(self, new_axes) |
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 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
(MyLine
is 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().axes
resoves to the return of the getter, not the property descriptor)
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.
…657-on-v3.8.x Backport PR #26657 on branch v3.8.x (DOC: Fix some small issues)
PR summary
PR checklist