Skip to content

Commit c225fc2

Browse files
committed
Allow comparing DocPaths
1 parent 36d9a41 commit c225fc2

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

mkdocstrings/handlers/crystal/items.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,3 +512,11 @@ def __str__(self) -> str:
512512

513513
def __repr__(self) -> str:
514514
return repr(self.full_name)
515+
516+
def __eq__(self, other) -> bool:
517+
if isinstance(other, DocPath):
518+
other = other.abs_id
519+
return isinstance(other, str) and self.abs_id == other
520+
521+
def __hash__(self):
522+
return hash(self.abs_id)

0 commit comments

Comments
 (0)