From b6e66ebdf76c56b4a893c0687f91d1e6dd9cac2d Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Thu, 28 Nov 2013 06:53:05 -0800 Subject: [PATCH] Some minor clarifications in the documentation of pathlib + inheritance diagram --- Doc/library/pathlib-inheritance.png | Bin 0 -> 11280 bytes Doc/library/pathlib.rst | 148 +++++++++++++++------------- 2 files changed, 80 insertions(+), 68 deletions(-) create mode 100644 Doc/library/pathlib-inheritance.png diff --git a/Doc/library/pathlib-inheritance.png b/Doc/library/pathlib-inheritance.png new file mode 100644 index 0000000000000000000000000000000000000000..b81c3deb6049d83051337776fe5c4f3de751e1cb GIT binary patch literal 11280 zcmb_?2{@GN|M$?oC`&36*>g%rmh4IliYCdv7G(?B*Fn2viHei;WH4l3hHN91EsQ3^ zFoP-Egl6m}#_)e0%lXwg{od>SU+wcE+{@nNX{@ma1JidHMn{79AHv|G<)78a)G)&21@{qG;PZ#%-fvwzEu zeY^^{1vDK6**MI@*#$N3AB<)Pu7%1zv7vxFVM{@cJsbt>uO0|z2;SYYLxXpx_CD*| z0z1C?E2ajG44%bu(=d#R(zJ0S_d26^qs&aSx{ayneD}a)U0|vMf{gB#L}dZi{D1iu zMtFGSy)V4;*k4Susx5CXj#4YgAqtRVVfsn(s)BQEL10;EUO*=vl;W-MXui?@2V z5Ba)Cf0o{r?lC>sP`@}!p_E-rkYqcm9#Zp~;xp73HJMC!u;&m=sOYMvl}VvBmDyWh zReeG}-X~J-BvkZ}Uy{mFW(g~VnJ#S_>7D0;dlN*b*`@}a?s?-elwE2g;rqP@7i8Vp z*?F%M1($M4;}4#yx24niYt^fR7iYdXXb!#flm?tJSK~dj#npLy!oy?Pz9&TfRw%T* zX^(D`NTj2R|CDV}!0c!}Hbq&R?|X`}A53`15&2t(ecHqYWjNw#-kO*?;QbdO+6C$L zZRQ&eSzm0|1glG!AQZ-6C6F9)Gq)KFR7J)|dansKRIU70@99Fv`_IJS*a#R_qREOH zn_|QswKzQZwTS7_6LNZG(RP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BE}`F@(7uo zR7RP3G$~qT*fbXDR@?5Qm0D7W@23U6!9dk*qS_Qq`rTaY$h8=oCx3 zhq~BbPR~9)oDMlpj~Lvc{-Zwh;~rNHV%>S$2{ou^0XcQGE@>8M H*xvmghTl=r literal 0 HcmV?d00001 diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index d4e08629d8..a8c1dc9e80 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -9,15 +9,27 @@ .. versionadded:: 3.4 - This module offers classes representing filesystem paths with semantics appropriate for different operating systems. Path classes are divided between :ref:`pure paths `, which provide purely computational operations without I/O, and :ref:`concrete paths `, which inherit from pure paths but also provide I/O operations. -The main point of entry is the :class:`Path` class, which will instantiate -a :ref:`concrete path ` for the current platform. +.. image:: pathlib-inheritance.png + :align: center + +If you've never used this module before or just aren't sure which class is +right for your task, :class:`Path` is most likely what you need. It instantiates +a :ref:`concrete path ` for the platform the code is running on. + +Pure paths are useful in some special cases; for example: + +#. If you want to manipulate Windows paths on a Unix machine (or vice versa). + You cannot instantiate a :class:`WindowsPath` when running on Unix, but you + can instantiate :class:`PureWindowsPath`. +#. You want to make sure that your code only manipulates paths without actually + accessing the OS. In this case, instantiating one of the pure classes may be + useful since those simply don't have any OS-accessing operations. .. note:: This module has been included in the standard library on a @@ -86,82 +98,78 @@ Pure path objects provide path-handling operations which don't actually access a filesystem. There are three ways to access these classes, which we also call *flavours*: +.. class:: PurePath(*pathsegments) -.. class:: PurePosixPath - - A subclass of :class:`PurePath`, this path flavour represents non-Windows - filesystem paths:: - - >>> PurePosixPath('/etc') - PurePosixPath('/etc') + A generic class that represents the system's path flavour (instantiating + it creates either a :class:`PurePosixPath` or a :class:`PureWindowsPath`):: -.. class:: PureWindowsPath + >>> PurePath('setup.py') # Running on a Unix machine + PurePosixPath('setup.py') - A subclass of :class:`PurePath`, this path flavour represents Windows - filesystem paths:: + Each element of *pathsegments* can be either a string or bytes object + representing a path segment; it can also be another path object:: - >>> PureWindowsPath('c:/Program Files/') - PureWindowsPath('c:/Program Files') + >>> PurePath('foo', 'some/path', 'bar') + PurePosixPath('foo/some/path/bar') + >>> PurePath(Path('foo'), Path('bar')) + PurePosixPath('foo/bar') -.. class:: PurePath + When *pathsegments* is empty, the current directory is assumed:: - A generic class that represents the system's path flavour (instantiating - it creates either a :class:`PurePosixPath` or a :class:`PureWindowsPath`):: + >>> PurePath() + PurePosixPath('.') - >>> PurePath('setup.py') - PurePosixPath('setup.py') + When several absolute paths are given, the last is taken as an anchor + (mimicking :func:`os.path.join`'s behaviour):: + >>> PurePath('/etc', '/usr', 'lib64') + PurePosixPath('/usr/lib64') + >>> PureWindowsPath('c:/Windows', 'd:bar') + PureWindowsPath('d:bar') -Regardless of the system you're running on, you can instantiate all of -these classes, since they don't provide any operation that does system calls. + However, in a Windows path, changing the local root doesn't discard the + previous drive setting:: + >>> PureWindowsPath('c:/Windows', '/Program Files') + PureWindowsPath('c:/Program Files') -Constructing paths -^^^^^^^^^^^^^^^^^^ + Spurious slashes and single dots are collapsed, but double dots (``'..'``) + are not, since this would change the meaning of a path in the face of + symbolic links:: -Path constructors accept an arbitrary number of positional arguments. -When called without any argument, a path object points to the current -directory:: + >>> PurePath('foo//bar') + PurePosixPath('foo/bar') + >>> PurePath('foo/./bar') + PurePosixPath('foo/bar') + >>> PurePath('foo/../bar') + PurePosixPath('foo/../bar') - >>> PurePath() - PurePosixPath('.') + (a naïve approach would make ``PurePosixPath('foo/../bar')`` equivalent + to ``PurePosixPath('bar')``, which is wrong if ``foo`` is a symbolic link + to another directory) -Any argument can be a string or bytes object representing an arbitrary number -of path segments, but it can also be another path object:: +.. class:: PurePosixPath(*pathsegments) - >>> PurePath('foo', 'some/path', 'bar') - PurePosixPath('foo/some/path/bar') - >>> PurePath(Path('foo'), Path('bar')) - PurePosixPath('foo/bar') + A subclass of :class:`PurePath`, this path flavour represents non-Windows + filesystem paths:: -When several absolute paths are given, the last is taken as an anchor -(mimicking :func:`os.path.join`'s behaviour):: + >>> PurePosixPath('/etc') + PurePosixPath('/etc') - >>> PurePath('/etc', '/usr', 'lib64') - PurePosixPath('/usr/lib64') - >>> PureWindowsPath('c:/Windows', 'd:bar') - PureWindowsPath('d:bar') + *pathsegments* is specified similarly to :class:`PurePath`. -However, in a Windows path, changing the local root doesn't discard the -previous drive setting:: +.. class:: PureWindowsPath(*pathsegments) - >>> PureWindowsPath('c:/Windows', '/Program Files') - PureWindowsPath('c:/Program Files') + A subclass of :class:`PurePath`, this path flavour represents Windows + filesystem paths:: -Spurious slashes and single dots are collapsed, but double dots (``'..'``) -are not, since this would change the meaning of a path in the face of -symbolic links:: + >>> PureWindowsPath('c:/Program Files/') + PureWindowsPath('c:/Program Files') - >>> PurePath('foo//bar') - PurePosixPath('foo/bar') - >>> PurePath('foo/./bar') - PurePosixPath('foo/bar') - >>> PurePath('foo/../bar') - PurePosixPath('foo/../bar') + *pathsegments* is specified similarly to :class:`PurePath`. -(a naïve approach would make ``PurePosixPath('foo/../bar')`` equivalent -to ``PurePosixPath('bar')``, which is wrong if ``foo`` is a symbolic link -to another directory) +Regardless of the system you're running on, you can instantiate all of +these classes, since they don't provide any operation that does system calls. General properties @@ -524,8 +532,18 @@ 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) + + A subclass of :class:`PurePath`, this class represents concrete paths of + the system's path flavour (instantiating it creates either a + :class:`PosixPath` or a :class:`WindowsPath`):: + + >>> Path('setup.py') + PosixPath('setup.py') + + *pathsegments* is specified similarly to :class:`PurePath`. -.. class:: PosixPath +.. class:: PosixPath(*pathsegments) A subclass of :class:`Path` and :class:`PurePosixPath`, this class represents concrete non-Windows filesystem paths:: @@ -533,7 +551,9 @@ calls on path objects. There are three ways to instantiate concrete paths: >>> PosixPath('/etc') PosixPath('/etc') -.. class:: WindowsPath + *pathsegments* is specified similarly to :class:`PurePath`. + +.. class:: WindowsPath(*pathsegments) A subclass of :class:`Path` and :class:`PureWindowsPath`, this class represents concrete Windows filesystem paths:: @@ -541,15 +561,7 @@ calls on path objects. There are three ways to instantiate concrete paths: >>> WindowsPath('c:/Program Files/') WindowsPath('c:/Program Files') -.. class:: Path - - A subclass of :class:`PurePath`, this class represents concrete paths of - the system's path flavour (instantiating it creates either a - :class:`PosixPath` or a :class:`WindowsPath`):: - - >>> Path('setup.py') - PosixPath('setup.py') - + *pathsegments* is 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 -- 2.40.0