Skip to content

Commit d2b9ed3

Browse files
committed
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.
1 parent 9ea72e9 commit d2b9ed3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Doc/library/pathlib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,7 @@ 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 :data:`PurePath.suffix`
13041304
==================================== ==============================
13051305

13061306
.. rubric:: Footnotes

0 commit comments

Comments
 (0)