Skip to content

Commit

Permalink
Implement hash() for string paths
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Aug 23, 2023
1 parent 2986aa1 commit 494de73
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sphinx/util/_pathlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ def __eq__(self, other):
return self.__str__() == other
return NotImplemented

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

def __getitem__(self, item):
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
return self.__str__()[item]
Expand Down Expand Up @@ -88,6 +91,9 @@ def __eq__(self, other):
return self.__str__() == other
return NotImplemented

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

def __getitem__(self, item):
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
return self.__str__()[item]
Expand Down

0 comments on commit 494de73

Please sign in to comment.