Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Raise correct exception out of Spines.__getattr__#21570
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
If the name does not exist, then `__getattr__` should raise`AttributeError`, not `ValueError`.Fixesmatplotlib#21554
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.
Looks good, but I'm not sure this closes the issue though. Now, we'll at least get the right error, but it still isn't a super helpful message for the user.
AttributeError: 'Spines' object does not contain a '__deepcopy__' spine
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.
Approve for changing the error type.
It's however not a fix to the reported issue.deepcopy(figure)
should not fail on some random internal state. Either we forbid it explicitly or somebody has to make it work with a reasonable meaning.
…570-on-v3.5.xBackport PR#21570 on branch v3.5.x (Raise correct exception out of Spines.__getattr__)
…570-on-v3.4.xBackport PR#21570 on branch v3.4.x (Raise correct exception out of Spines.__getattr__)
PR Summary
If the name does not exist, then
__getattr__
should raiseAttributeError
, notValueError
.Fixes#21554
PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
and runflake8 --docstring-convention=all
).doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).