From 494de7327f23e1b8a09f4e327f6d4cdf4e351013 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Wed, 23 Aug 2023 22:52:00 +0100 Subject: [PATCH] Implement ``hash()`` for string paths --- sphinx/util/_pathlib.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sphinx/util/_pathlib.py b/sphinx/util/_pathlib.py index ef85e7349..db22c927a 100644 --- a/sphinx/util/_pathlib.py +++ b/sphinx/util/_pathlib.py @@ -50,6 +50,9 @@ if sys.platform == 'win32': 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] @@ -88,6 +91,9 @@ else: 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]