Skip to content

Commit

Permalink
Making DSDLDefinition hashable
Browse files Browse the repository at this point in the history
The canonical representation being full name + version. For example: `foo.bar.Type.1.0`
  • Loading branch information
thirtytwobits committed Apr 1, 2024
1 parent 4f651a6 commit aa5b3ff
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pydsdl/_dsdl_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ def root_namespace_path(self) -> Path:
# +-----------------------------------------------------------------------+
# | Python :: SPECIAL FUNCTIONS |
# +-----------------------------------------------------------------------+
def __hash__(self) -> int:
return hash((self.full_name, self.version))

def __eq__(self, other: object) -> bool:
"""
Expand Down

0 comments on commit aa5b3ff

Please sign in to comment.