mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Implement `hash()` for string paths
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user