Skip to content

Commit

Permalink
Merge pull request #204 from kelnage/sigma-level-hash-fn
Browse files Browse the repository at this point in the history
Add `__hash__` function to `SigmaLevel` & `SigmaStatus`
  • Loading branch information
thomaspatzke authored Mar 26, 2024
2 parents 1e2f076 + 8f74521 commit cece15b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sigma/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ def __lt__(self, other):

raise sigma_exceptions.SigmaTypeError("Must be a SigmaStatus", source=other)

def __hash__(self):
return self.value.__hash__()


class SigmaLevel(EnumLowercaseStringMixin, Enum):
INFORMATIONAL = auto()
Expand Down Expand Up @@ -123,6 +126,9 @@ def __lt__(self, other):

raise sigma_exceptions.SigmaTypeError("Must be a SigmaLevel", source=other)

def __hash__(self):
return self.value.__hash__()


class SigmaRelatedType(EnumLowercaseStringMixin, Enum):
OBSOLETES = auto()
Expand Down

0 comments on commit cece15b

Please sign in to comment.