Skip to content

Commit

Permalink
NPI-3458 added equality check to solution types based just on short name
Browse files Browse the repository at this point in the history
  • Loading branch information
treefern committed Aug 20, 2024
1 parent fc94695 commit 0f2341e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions gnssanalysis/solution_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ def __str__(self) -> str:
def __repr__(self) -> str:
return self._name

def __eq__(self, other):
"""
Override default equality check
"""
if not isinstance(other, SolutionType):
return False
return self._name == other._name
# Note that in Python, there is both an equality and an inequality check.
# But in Python 3 the inequality check leverages 'not __eq__()' by default.


class SolutionTypes:
"""
Expand Down

0 comments on commit 0f2341e

Please sign in to comment.