Skip to content

Commit f63868e

Browse files
authored
feat(StringEnum): implement hash method using value as hash (#31)
1 parent b9077bb commit f63868e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/core/ydata/core/enum/string_enum.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,8 @@ def _key_from_str(cls, value: str):
2626

2727
return None
2828

29+
def __hash__(self) -> int:
30+
return hash(self.value)
31+
2932
def __eq__(self, other: object) -> bool:
3033
return self.value == other.value

0 commit comments

Comments
 (0)