Skip to content

Commit 677910d

Browse files
committed
Make comparions more explicit
1 parent 9f8790d commit 677910d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pandas/core/indexes/base.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,12 @@ def is_(self, other) -> bool:
543543
"""
544544
if self is other:
545545
return True
546+
elif not hasattr(other, "_id"):
547+
return False
548+
elif com.any_none(self._id, other._id):
549+
return False
546550
else:
547-
return self._id is not None and self._id is getattr(other, "_id", Ellipsis)
551+
return self._id is other._id
548552

549553
def _reset_identity(self) -> None:
550554
"""

0 commit comments

Comments
 (0)