You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Re-order table of corresponding functions with the following priorities:
1. Pure functionality is at the top
2. `os.path` functions are shown before `os` functions
3. Similar functionality is kept together
4. Functionality follows docs order where possible
Add a few missed correspondences:
- `os.path.isjunction` and `Path.is_junction`
- `os.path.ismount` and `Path.is_mount`
- `os.lstat()` and `Path.lstat()`
- `os.lchmod()` and `Path.lchmod()`
Also add footnotes describing a few differences.
(cherry picked from commit cbac8a3)
.. [#] :func:`os.path.abspath` normalizes the resulting path, which may change its meaning in the presence of symlinks, while :meth:`Path.absolute` does not.
1577
-
.. [#] :meth:`PurePath.relative_to` requires ``self`` to be the subpath of the argument, but :func:`os.path.relpath` does not.
1568
+
.. [1] :func:`os.path.relpath` calls :func:`~os.path.abspath` to make paths
1569
+
absolute and remove "``..``" parts, whereas :meth:`PurePath.relative_to`
1570
+
is a lexical operation that raises :exc:`ValueError` when its inputs'
1571
+
anchors differ (e.g. if one path is absolute and the other relative.)
1572
+
.. [2] :func:`os.path.expanduser` returns the path unchanged if the home
1573
+
directory can't be resolved, whereas :meth:`Path.expanduser` raises
1574
+
:exc:`RuntimeError`.
1575
+
.. [3] :func:`os.path.abspath` removes "``..``" components without resolving
1576
+
symlinks, which may change the meaning of the path, whereas
1577
+
:meth:`Path.absolute` leaves any "``..``" components in the path.
1578
+
.. [4] :func:`os.walk` always follows symlinks when categorizing paths into
1579
+
*dirnames* and *filenames*, whereas :meth:`Path.walk` categorizes all
1580
+
symlinks into *filenames* when *follow_symlinks* is false (the default.)
0 commit comments