summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/pathlib/__init__.py4
-rw-r--r--Misc/NEWS.d/next/Library/2023-12-07-20-05-54.gh-issue-112855.ph4ehh.rst2
2 files changed, 3 insertions, 3 deletions
diff --git a/Lib/pathlib/__init__.py b/Lib/pathlib/__init__.py
index a4721fb..f03f317 100644
--- a/Lib/pathlib/__init__.py
+++ b/Lib/pathlib/__init__.py
@@ -169,9 +169,7 @@ class PurePath(_abc.PurePathBase):
return NotImplemented
def __reduce__(self):
- # Using the parts tuple helps share interned path parts
- # when pickling related paths.
- return (self.__class__, self.parts)
+ return self.__class__, tuple(self._raw_paths)
def __repr__(self):
return "{}({!r})".format(self.__class__.__name__, self.as_posix())
diff --git a/Misc/NEWS.d/next/Library/2023-12-07-20-05-54.gh-issue-112855.ph4ehh.rst b/Misc/NEWS.d/next/Library/2023-12-07-20-05-54.gh-issue-112855.ph4ehh.rst
new file mode 100644
index 0000000..6badc7a
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2023-12-07-20-05-54.gh-issue-112855.ph4ehh.rst
@@ -0,0 +1,2 @@
+Speed up pickling of :class:`pathlib.PurePath` objects. Patch by Barney
+Gale.