mirror of
https://github.com/python/cpython
synced 2024-10-06 14:49:41 +00:00
GH-112906: Fix performance regression in pathlib path initialisation (#112907)
This was caused by 76929fdeeb
, specifically its use of `super()` and its
packing/unpacking `*args`.
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
parent
96f64a2b1b
commit
23df46a1dd
|
@ -90,7 +90,9 @@ def __init__(self, *args):
|
|||
"object where __fspath__ returns a str, "
|
||||
f"not {type(path).__name__!r}")
|
||||
paths.append(path)
|
||||
super().__init__(*paths)
|
||||
# Avoid calling super().__init__, as an optimisation
|
||||
self._raw_paths = paths
|
||||
self._resolving = False
|
||||
|
||||
def __reduce__(self):
|
||||
# Using the parts tuple helps share interned path parts
|
||||
|
|
Loading…
Reference in a new issue