-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Avoid comparing numpy array to strings in two places #7658
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
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.
Apart from the suggested change in implementation, this is good.
@@ -1282,7 +1282,7 @@ def set_aspect(self, aspect, adjustable=None, anchor=None): | |||
etc. | |||
===== ===================== | |||
""" | |||
if aspect in ('equal', 'auto'): | |||
if isinstance(aspect, str) and aspect in ('equal', 'auto'): |
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.
It might be better to use cbook.is_string_like
instead of is_instance
. Or at least six.string_types
in place of str
.
There was another similar warning coming up in in #5806 that I have also fixed. |
Test failures are unrelated (common random failures). |
LGTM 👍 |
Fixes #5806