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

Skip to content

Fix string comparison #12881

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
Nov 28, 2018
Merged

Conversation

timhoffm
Copy link
Member

PR Summary

String comparison should be done with != not with is not.

@timhoffm timhoffm added this to the v3.1 milestone Nov 24, 2018
@QuLogic
Copy link
Member

QuLogic commented Nov 25, 2018

Is marker guaranteed to be a string? Because in Matplotlib itself (not necessarily the Qt editor), it could be an array_like, which would cause a warning when comparing to a string.

@timhoffm
Copy link
Member Author

I've tested this and marker is a matplotlib marker definition, i.e. a plain python str or int (https://matplotlib.org/gallery/lines_bars_and_markers/marker_reference.html). So it's ok.

@QuLogic
Copy link
Member

QuLogic commented Nov 28, 2018

Markers are also allowed to be Paths, as in https://matplotlib.org/gallery/shapes_and_collections/marker_path.html or NumPy arrays, but both of those seem to be broken in some other ways than this PR.

@QuLogic QuLogic merged commit 24a5d58 into matplotlib:master Nov 28, 2018
@timhoffm timhoffm deleted the fix-string-comparision branch November 28, 2018 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants