From a52c7d63e6754ced873f573981053591cf842832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Sun, 5 Feb 2023 22:08:52 +0000 Subject: [PATCH 1/2] GH-99189: improve the documentation for zipfile.Path and Traversable --- Doc/library/importlib.resources.abc.rst | 5 ++++- Doc/library/zipfile.rst | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Doc/library/importlib.resources.abc.rst b/Doc/library/importlib.resources.abc.rst index 7747e89a833c02..0638c4de718cab 100644 --- a/Doc/library/importlib.resources.abc.rst +++ b/Doc/library/importlib.resources.abc.rst @@ -89,9 +89,12 @@ .. class:: Traversable - An object with a subset of pathlib.Path methods suitable for + An object with a subset of :class:`pathlib.Path` methods suitable for traversing directories and opening files. + If you need a representation of the object on the file-system, you can use + :meth:`importlib.resources.as_file`. + .. versionadded:: 3.9 .. deprecated-removed:: 3.12 3.14 diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst index 1c516723f04a33..0195abc3a992c1 100644 --- a/Doc/library/zipfile.rst +++ b/Doc/library/zipfile.rst @@ -55,8 +55,9 @@ The module defines the following items: .. class:: Path :noindex: - A pathlib-compatible wrapper for zip files. See section - :ref:`path-objects` for details. + Class that implements a subset of the interface provided by + :class:`pathlib.Path`, including the full + :class:`importlib.resources.abc.Traversable` interface. .. versionadded:: 3.8 From 6af277a2ee06f2dfd697f3720906050c408ef516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Mon, 20 Feb 2023 19:14:15 +0000 Subject: [PATCH 2/2] Update Doc/library/importlib.resources.abc.rst Co-authored-by: Jason R. Coombs --- Doc/library/importlib.resources.abc.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/importlib.resources.abc.rst b/Doc/library/importlib.resources.abc.rst index 0638c4de718cab..2d0f137ffc7996 100644 --- a/Doc/library/importlib.resources.abc.rst +++ b/Doc/library/importlib.resources.abc.rst @@ -92,7 +92,7 @@ An object with a subset of :class:`pathlib.Path` methods suitable for traversing directories and opening files. - If you need a representation of the object on the file-system, you can use + For a representation of the object on the file-system, use :meth:`importlib.resources.as_file`. .. versionadded:: 3.9