Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions Doc/library/pathlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1055,3 +1055,36 @@ call fails (for example because the path doesn't exist):
'Text file contents'

.. versionadded:: 3.5

Correspondence to tools in the :mod:`os` module
-----------------------------------------------

Below is a table mapping various :mod:`os` functions to their corresponding
:class:`PurePath`/:class:`Path` equivalent.

.. note::

Although :func:`os.path.relpath` and :meth:`PurePath.relative_to` have some
overlapping use-cases, their semantics differ enough to warrant not
considering them equivalent.

============================ ==============================
os and os.path pathlib
============================ ==============================
:func:`os.path.abspath` :meth:`Path.resolve`
:func:`os.getcwd` :func:`Path.cwd`
:func:`os.path.exists` :meth:`Path.exists`
:func:`os.path.expanduser` :meth:`Path.expanduser` and
:meth:`Path.home`
:func:`os.path.isdir` :meth:`Path.is_dir`
:func:`os.path.isfile` :meth:`Path.is_file`
:func:`os.path.islink` :meth:`Path.is_symlink`
:func:`os.stat` :meth:`Path.stat`,
:meth:`Path.owner`,
:meth:`Path.group`
:func:`os.path.isabs` :meth:`PurePath.is_absolute`
:func:`os.path.join` :func:`PurePath.joinpath`
:func:`os.path.basename` :data:`PurePath.name`
:func:`os.path.dirname` :data:`PurePath.parent`
:func:`os.path.splitext` :data:`PurePath.suffix`
============================ ==============================
9 changes: 5 additions & 4 deletions Misc/ACKS
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Fred Allen
Jeff Allen
Ray Allen
Billy G. Allie
Jamiel Almeida
Kevin Altis
Skyler Leigh Amador
Joe Amenta
Expand Down Expand Up @@ -436,6 +437,7 @@ Tim Everett
Paul Everitt
David Everly
Daniel Evers
evilzero
Winston Ewert
Greg Ewing
Martijn Faassen
Expand Down Expand Up @@ -523,6 +525,7 @@ Elazar (אלעזר) Gershuni
Ben Gertzfield
Nadim Ghaznavi
Dinu Gherman
Subhendu Ghosh
Jonathan Giddy
Johannes Gijsbers
Michael Gilfix
Expand Down Expand Up @@ -1239,6 +1242,7 @@ Jérôme Radix
Burton Radons
Abhilash Raj
Shorya Raj
Dhushyanth Ramasamy
Jeff Ramnani
Bayard Randel
Varpu Rantala
Expand Down Expand Up @@ -1502,6 +1506,7 @@ Nathan Sullivan
Mark Summerfield
Reuben Sumner
Eryk Sun
Sanjay Sundaresan
Marek Šuppa
Hisao Suzuki
Kalle Svensson
Expand Down Expand Up @@ -1744,7 +1749,3 @@ Jelle Zijlstra
Gennadiy Zlobin
Doug Zongker
Peter Åstrand
evilzero
Dhushyanth Ramasamy
Subhendu Ghosh
Sanjay Sundaresan