mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +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
1 changed files with 3 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue