From ff347ce746142a85382645e307b9b337dad7dba1 Mon Sep 17 00:00:00 2001 From: barneygale Date: Sat, 29 Jun 2024 16:34:00 +0100 Subject: [PATCH 1/3] GH-119054: Add alt text to pathlib inheritance diagram --- Doc/library/pathlib.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index 49b9c8f4193396..9e38292685e93e 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -21,6 +21,15 @@ inherit from pure paths but also provide I/O operations. .. image:: pathlib-inheritance.png :align: center :class: invert-in-dark-mode + :alt: Inheritance diagram showing the classes available in pathlib. The + most basic class is ``PurePath``, which has three direct subclasses: + ``PurePosixPath``, ``PureWindowsPath``, and ``Path``. Further to + these four classes, there are two classes that use multiple + inheritance: ``PosixPath`` subclasses ``PurePosixPath`` and ``Path``, + and ``WindowsPath`` subclasses ``PureWindowsPath`` and ``Path``. The + upper part of the diagram shows the three pure classes, starting with + ``PurePath``, and the lower part shows the three concrete classes, + ending with ``PosixPath`` and ``WindowsPath``. If you've never used this module before or just aren't sure which class is right for your task, :class:`Path` is most likely what you need. It instantiates From fe50f4af81205981ee8829e80400275eff89bdd5 Mon Sep 17 00:00:00 2001 From: barneygale Date: Sat, 29 Jun 2024 16:42:02 +0100 Subject: [PATCH 2/3] Remove reST markup --- Doc/library/pathlib.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index 9e38292685e93e..087a932860d451 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -22,14 +22,14 @@ inherit from pure paths but also provide I/O operations. :align: center :class: invert-in-dark-mode :alt: Inheritance diagram showing the classes available in pathlib. The - most basic class is ``PurePath``, which has three direct subclasses: - ``PurePosixPath``, ``PureWindowsPath``, and ``Path``. Further to - these four classes, there are two classes that use multiple - inheritance: ``PosixPath`` subclasses ``PurePosixPath`` and ``Path``, - and ``WindowsPath`` subclasses ``PureWindowsPath`` and ``Path``. The - upper part of the diagram shows the three pure classes, starting with - ``PurePath``, and the lower part shows the three concrete classes, - ending with ``PosixPath`` and ``WindowsPath``. + most basic class is PurePath, which has three direct subclasses: + PurePosixPath, PureWindowsPath, and Path. Further to these four + classes, there are two classes that use multiple inheritance: + PosixPath subclasses PurePosixPath and Path, and WindowsPath + subclasses PureWindowsPath and Path. The upper part of the diagram + shows the three pure classes, starting with PurePath, and the lower + part shows the three concrete classes, ending with PosixPath and + WindowsPath. If you've never used this module before or just aren't sure which class is right for your task, :class:`Path` is most likely what you need. It instantiates From 53f6e458e50b4b3cc945e9b85bd755bc38256382 Mon Sep 17 00:00:00 2001 From: Barney Gale Date: Sat, 29 Jun 2024 18:30:55 +0100 Subject: [PATCH 3/3] Update Doc/library/pathlib.rst Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- Doc/library/pathlib.rst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index 087a932860d451..0918bbb47e9ea6 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -26,10 +26,7 @@ inherit from pure paths but also provide I/O operations. PurePosixPath, PureWindowsPath, and Path. Further to these four classes, there are two classes that use multiple inheritance: PosixPath subclasses PurePosixPath and Path, and WindowsPath - subclasses PureWindowsPath and Path. The upper part of the diagram - shows the three pure classes, starting with PurePath, and the lower - part shows the three concrete classes, ending with PosixPath and - WindowsPath. + subclasses PureWindowsPath and Path. If you've never used this module before or just aren't sure which class is right for your task, :class:`Path` is most likely what you need. It instantiates