Skip to content
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

Remove redundant total_ordering decorator usage #4203

Merged
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
clean up comment
  • Loading branch information
DanielYang59 committed Nov 28, 2024
commit 2a8817773f9d9ef6a4dc32efe0d94b1e7c58dec1
1 change: 1 addition & 0 deletions src/pymatgen/core/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,7 @@ def __init__(
self._properties = properties or {}

def __eq__(self, other: object) -> bool:
"""Define equality by comparing all three attributes: lattice, sites, properties."""
needed_attrs = ("lattice", "sites", "properties")

if not all(hasattr(other, attr) for attr in needed_attrs):
Expand Down
Loading