Skip to content

Commit 3789c63

Browse files
acdhaezio-melotti
andauthored
Add additional pointers to pathlib's mapping to os.path functions (#94828)
* Add additional pointers to pathlib's mapping to os.path functions os.path.splitext has a somewhat quirky signature since it mixes the path and filename components but I wanted the documentation to mention `PurePath.stem` as the natural counterpart to `PurePath.suffix` for the common use of `os.path.splitext` to turn "file.py" into "file" and "py". Technically this could have some discussion of how to handle the parent directory hierarchy but that seems a bit out of keeping with the spirit of this table so I omitted mentioning `PurePath.parents` here. * Update Doc/library/pathlib.rst Co-authored-by: Ezio Melotti <[email protected]> Co-authored-by: Ezio Melotti <[email protected]>
1 parent 582ae86 commit 3789c63

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Doc/library/pathlib.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,8 @@ Below is a table mapping various :mod:`os` functions to their corresponding
13001300
:func:`os.path.basename` :data:`PurePath.name`
13011301
:func:`os.path.dirname` :data:`PurePath.parent`
13021302
:func:`os.path.samefile` :meth:`Path.samefile`
1303-
:func:`os.path.splitext` :data:`PurePath.suffix`
1303+
:func:`os.path.splitext` :data:`PurePath.stem` and
1304+
:data:`PurePath.suffix`
13041305
==================================== ==============================
13051306

13061307
.. rubric:: Footnotes

0 commit comments

Comments
 (0)