Skip to content
This repository was archived by the owner on Dec 12, 2023. It is now read-only.

Commit 40e4bb2

Browse files
committed
urn: add hash function
1 parent 96755b2 commit 40e4bb2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

linkedin_messaging/api_objects.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ def __str__(self):
3535
),
3636
)
3737

38-
def __eq__(self, other: Any):
38+
def __hash__(self) -> int:
39+
return hash(self.id_str())
40+
41+
def __eq__(self, other: Any) -> bool:
3942
if not isinstance(other, URN):
4043
return False
4144
return self.id_parts == other.id_parts

0 commit comments

Comments
 (0)