We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 097c563 commit e1a76daCopy full SHA for e1a76da
1 file changed
Lib/pathlib/__init__.py
@@ -209,7 +209,12 @@ def __hash__(self):
209
try:
210
return self._hash
211
except AttributeError:
212
- self._hash = hash(self._str_normcase)
+ hash_data = self._tail
213
+ if self._drv or self._root:
214
+ hash_data = [self._drv + self._root] + self._tail
215
+ elif self._tail and self.parser.splitdrive(self._tail[0])[0]:
216
+ hash_data = ['.'] + self._tail
217
+ self._hash = hash(tuple(hash_data))
218
219
220
def __eq__(self, other):
0 commit comments