Skip to content

Commit 8ef7929

Browse files
authored
Fix PurePath.relative_to links in the pathlib documentation. (pythonGH-93268)
These are currently broken as they refer to :meth:`Path.relative_to` rather than :meth:`PurePath.relative_to`, and `relative_to` is a method on `PurePath`.
1 parent 296081a commit 8ef7929

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/library/pathlib.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,7 @@ Below is a table mapping various :mod:`os` functions to their corresponding
12651265
:func:`os.link` :meth:`Path.hardlink_to`
12661266
:func:`os.symlink` :meth:`Path.symlink_to`
12671267
:func:`os.readlink` :meth:`Path.readlink`
1268-
:func:`os.path.relpath` :meth:`Path.relative_to` [#]_
1268+
:func:`os.path.relpath` :meth:`PurePath.relative_to` [#]_
12691269
:func:`os.stat` :meth:`Path.stat`,
12701270
:meth:`Path.owner`,
12711271
:meth:`Path.group`
@@ -1280,4 +1280,4 @@ Below is a table mapping various :mod:`os` functions to their corresponding
12801280
.. rubric:: Footnotes
12811281

12821282
.. [#] :func:`os.path.abspath` normalizes the resulting path, which may change its meaning in the presence of symlinks, while :meth:`Path.absolute` does not.
1283-
.. [#] :meth:`Path.relative_to` requires ``self`` to be the subpath of the argument, but :func:`os.path.relpath` does not.
1283+
.. [#] :meth:`PurePath.relative_to` requires ``self`` to be the subpath of the argument, but :func:`os.path.relpath` does not.

0 commit comments

Comments
 (0)