-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Inherit the Artist.draw docstring in subclasses. #16010
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
Conversation
9bfe956
to
ad70829
Compare
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.
Btw, is it reasonable that we have three different signatures for draw?
def draw(self, renderer, *args, **kwargs):
def draw(self, renderer=None, inframe=False):
def draw(self, renderer):
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 a nice cleanup. I have just the one question, but won't hold up for that because this is not making anything worse.
@@ -2613,7 +2613,7 @@ def _update_title_position(self, renderer): | |||
# Drawing | |||
@martist.allow_rasterization | |||
def draw(self, renderer=None, inframe=False): |
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.
What about the parameters here? They're undocumented (though they were before too).
The 3 different signatures makes my skin crawl. By virtue of Actually, technically they're all more restrictive than their base class... |
I would rather just always make the signature |
At least the base class should not have any arguments except renderer. From a design perspective, it's perfectly fine for subclasses to add additional optional arguments. No need to anticipate that with Anyway, that should be done in a separate PR (made an issue for that: #16022). |
PR Summary
Per #16004 (comment).
PR Checklist