Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a6fdd0e
Add `pathlib.PurePath.makepath()`; unify path object construction
barneygale Nov 20, 2022
b061747
Fix reST role name.
barneygale Dec 24, 2022
99eb8b1
Move call to `os.getcwd()` back into `Path.cwd()`
barneygale Dec 24, 2022
4759d01
Merge branch 'main' into gh-100479-add-makepath
barneygale Jan 5, 2023
ef6f4c3
Merge branch 'main' into gh-100479-add-makepath
barneygale Apr 3, 2023
595b8ae
Add news blurb.
barneygale Apr 3, 2023
dcfe70a
Merge branch 'main' into gh-100479-add-makepath
barneygale Apr 9, 2023
117fe4b
Add whatsnew entry
barneygale Apr 10, 2023
e75dedc
Merge branch 'main' into gh-100479-add-makepath
barneygale Apr 12, 2023
5a6bd3f
Merge branch 'main' into gh-100479-add-makepath
barneygale Apr 13, 2023
f2f1048
other --> pathsegments
barneygale Apr 24, 2023
3c172fb
Update Lib/pathlib.py
barneygale Apr 24, 2023
4637109
joinpath(*args) --> joinpath(*pathsegments)
barneygale Apr 24, 2023
ae48454
Restore _PathParents
barneygale Apr 25, 2023
e7a8fe3
Add note to `parents` about potential reference cycle.
barneygale Apr 25, 2023
7f12faa
Replace `makepath()` method with `template` initialiser argument.
barneygale Apr 25, 2023
687c764
Apply suggestions from code review
barneygale Apr 25, 2023
d7e326a
Fix docs for other classes.
barneygale Apr 25, 2023
a65d499
Pass template to `super()` to support diamond inheritance.
barneygale Apr 26, 2023
d4b15d7
Fixed missed `template` argument to super().
barneygale Apr 26, 2023
958b183
template --> blueprint
barneygale Apr 27, 2023
1e10188
Merge branch 'main' into gh-100479-add-makepath
barneygale May 2, 2023
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
Prev Previous commit
Next Next commit
Fix docs for other classes.
  • Loading branch information
barneygale committed Apr 25, 2023
commit d7e326a6f8e52cf9fdea77a76998f06a2d4ec653
20 changes: 10 additions & 10 deletions Doc/library/pathlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,17 +182,17 @@ we also call *flavours*:
.. versionchanged:: 3.6
Added support for the :class:`os.PathLike` interface.

.. class:: PurePosixPath(*pathsegments)
.. class:: PurePosixPath(*pathsegments, template=None)

A subclass of :class:`PurePath`, this path flavour represents non-Windows
filesystem paths::

>>> PurePosixPath('/etc')
PurePosixPath('/etc')

*pathsegments* is specified similarly to :class:`PurePath`.
*pathsegments* and *template* are specified similarly to :class:`PurePath`.

.. class:: PureWindowsPath(*pathsegments)
.. class:: PureWindowsPath(*pathsegments, template=None)

A subclass of :class:`PurePath`, this path flavour represents Windows
filesystem paths, including `UNC paths`_::
Expand All @@ -202,7 +202,7 @@ we also call *flavours*:
>>> PureWindowsPath('//server/share/file')
PureWindowsPath('//server/share/file')

*pathsegments* is specified similarly to :class:`PurePath`.
*pathsegments* and *template* are specified similarly to :class:`PurePath`.

.. _unc paths: https://en.wikipedia.org/wiki/Path_(computing)#UNC

Expand Down Expand Up @@ -716,7 +716,7 @@ Concrete paths are subclasses of the pure path classes. In addition to
operations provided by the latter, they also provide methods to do system
calls on path objects. There are three ways to instantiate concrete paths:

.. class:: Path(*pathsegments)
.. class:: Path(*pathsegments, template=None)

A subclass of :class:`PurePath`, this class represents concrete paths of
the system's path flavour (instantiating it creates either a
Expand All @@ -725,27 +725,27 @@ calls on path objects. There are three ways to instantiate concrete paths:
>>> Path('setup.py')
PosixPath('setup.py')

*pathsegments* is specified similarly to :class:`PurePath`.
*pathsegments* and *template* are specified similarly to :class:`PurePath`.

.. class:: PosixPath(*pathsegments)
.. class:: PosixPath(*pathsegments, template=None)

A subclass of :class:`Path` and :class:`PurePosixPath`, this class
represents concrete non-Windows filesystem paths::

>>> PosixPath('/etc')
PosixPath('/etc')

*pathsegments* is specified similarly to :class:`PurePath`.
*pathsegments* and *template* are specified similarly to :class:`PurePath`.

.. class:: WindowsPath(*pathsegments)
.. class:: WindowsPath(*pathsegments, template=None)

A subclass of :class:`Path` and :class:`PureWindowsPath`, this class
represents concrete Windows filesystem paths::

>>> WindowsPath('c:/Program Files/')
WindowsPath('c:/Program Files')

*pathsegments* is specified similarly to :class:`PurePath`.
*pathsegments* and *template* are specified similarly to :class:`PurePath`.

You can only instantiate the class flavour that corresponds to your system
(allowing system calls on non-compatible path flavours could lead to
Expand Down