mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
Merge 28bff4edb2 into f9704f1d84
This commit is contained in:
commit
39519030bf
2 changed files with 7 additions and 1 deletions
|
|
@ -210,7 +210,12 @@ class PurePath:
|
|||
try:
|
||||
return self._hash
|
||||
except AttributeError:
|
||||
self._hash = hash(self._str_normcase)
|
||||
if self.parser is posixpath:
|
||||
self._hash = hash((self.root, tuple(self._tail)))
|
||||
else:
|
||||
self._hash = hash((self.drive.lower(),
|
||||
self.root.lower(),
|
||||
tuple([part.lower() for part in self._tail])))
|
||||
return self._hash
|
||||
|
||||
def __eq__(self, other):
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
Avoid useless join operation when calculate the hash vaule for pathlib.Path.
|
||||
Loading…
Add table
Add a link
Reference in a new issue