diff --git a/pymatgen/core/structure.py b/pymatgen/core/structure.py index 650fa9ad1b2..d44104dd950 100644 --- a/pymatgen/core/structure.py +++ b/pymatgen/core/structure.py @@ -722,6 +722,8 @@ def matches(self, other, **kwargs): return m.fit(Structure.from_sites(self), Structure.from_sites(other)) def __eq__(self, other): + if other is self: + return True if other is None: return False if len(self) != len(other):