Avoid comparing numpy array to strings in two places#7658
Merged
QuLogic merged 3 commits intomatplotlib:masterfrom Dec 22, 2016
Merged
Avoid comparing numpy array to strings in two places#7658QuLogic merged 3 commits intomatplotlib:masterfrom
QuLogic merged 3 commits intomatplotlib:masterfrom
Conversation
efiring
requested changes
Dec 21, 2016
Member
efiring
left a comment
There was a problem hiding this comment.
Apart from the suggested change in implementation, this is good.
lib/matplotlib/axes/_base.py
Outdated
| ===== ===================== | ||
| """ | ||
| if aspect in ('equal', 'auto'): | ||
| if isinstance(aspect, str) and aspect in ('equal', 'auto'): |
Member
There was a problem hiding this comment.
It might be better to use cbook.is_string_like instead of is_instance. Or at least six.string_types in place of str.
Member
Author
|
There was another similar warning coming up in in #5806 that I have also fixed. |
efiring
approved these changes
Dec 22, 2016
Member
|
Test failures are unrelated (common random failures). |
Member
|
LGTM 👍 |
This was referenced Mar 1, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5806