Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Check type for set_clip_box #26700

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 1 commit into from
Sep 13, 2023
Merged

Conversation

oscargus
Copy link
Member

@oscargus oscargus commented Sep 5, 2023

PR summary

Related to #26522

Check the type before comparison to avoid non-informative errors.

PR checklist

Copy link
Member

@ksunden ksunden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some concerns about the game of whack-a-mole here, we clearly do not do this validation on most of the set_* methods.

But, adding to all would be a much larger task, and has performance considerations as well. And this one has proven to be problematic, in at least one instance, so not too upset at adding it here.

If it weren't for Artist.set() and **kwargs on __init__ expanding to set_* methods, I'd argue that this job is actually pretty well handled by type checking... But those are two pretty massive holes (as well as, of course, type checking being optional).

@oscargus
Copy link
Member Author

oscargus commented Sep 5, 2023

Yeah, I was browsing the other setters in artist, but most seemed quite "obvious". Maybe not much point adding type checking for bools, even though they will probably also fail similarly....

@ksunden ksunden added this to the v3.8.0 milestone Sep 11, 2023
@QuLogic QuLogic merged commit ec8c739 into matplotlib:main Sep 13, 2023
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Sep 13, 2023
QuLogic added a commit that referenced this pull request Sep 14, 2023
…700-on-v3.8.x

Backport PR #26700 on branch v3.8.x (Check type for set_clip_box)
@oscargus oscargus deleted the clipboxtypechecking branch September 14, 2023 05:13
@ksunden ksunden mentioned this pull request Sep 15, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants