Skip to content

Use is when comparing type of two objects #10504

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
Jul 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion xarray/plot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ def _get_color_and_size(value):
# Labels are not numerical so modifying label_values is not
# possible, instead filter the array with nicely distributed
# indexes:
if type(num) == int: # noqa: E721
if type(num) is int:
loc = mpl.ticker.LinearLocator(num)
else:
raise ValueError("`num` only supports integers for non-numeric labels.")
Expand Down
2 changes: 1 addition & 1 deletion xarray/tests/test_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -5635,7 +5635,7 @@ def test_duck_array_ops(self):

assert_units_equal(expected, actual)
# Don't use isinstance b/c we don't want to allow subclasses through
assert type(expected.data) == type(actual.data) # noqa: E721
assert type(expected.data) is type(actual.data)


@requires_matplotlib
Expand Down
Loading