Assorted comments by Jim Jewett
This commit is contained in:
parent
3129ea6d88
commit
734743d99b
10
pep-0428.txt
10
pep-0428.txt
|
@ -155,8 +155,8 @@ contrasts with some other Path class proposals which were derived from
|
||||||
if you want a path to act as a sequence, you have to lookup a dedicated
|
if you want a path to act as a sequence, you have to lookup a dedicated
|
||||||
attribute (the ``parts`` attribute).
|
attribute (the ``parts`` attribute).
|
||||||
|
|
||||||
By avoiding to pass as builtin types, the path classes minimize the potential
|
Not behaving like one of the basic builtin types also minimizes the potential
|
||||||
for confusion if they are combined by accident with genuine builtin types.
|
for confusion if a path is combined by accident with genuine builtin types.
|
||||||
|
|
||||||
|
|
||||||
Immutability
|
Immutability
|
||||||
|
@ -201,6 +201,9 @@ Paths of different flavours always compare unequal, and cannot be ordered::
|
||||||
File "<stdin>", line 1, in <module>
|
File "<stdin>", line 1, in <module>
|
||||||
TypeError: unorderable types: PurePosixPath() < PureWindowsPath()
|
TypeError: unorderable types: PurePosixPath() < PureWindowsPath()
|
||||||
|
|
||||||
|
Paths compare unequal to, and are not orderable with instances of builtin
|
||||||
|
types (such as ``str``) and any other types.
|
||||||
|
|
||||||
|
|
||||||
Useful notations
|
Useful notations
|
||||||
----------------
|
----------------
|
||||||
|
@ -315,7 +318,8 @@ which is a special case in the POSIX specification on `pathname resolution`_
|
||||||
PurePosixPath('//some/path')
|
PurePosixPath('//some/path')
|
||||||
|
|
||||||
Calling the constructor without any argument creates a path object pointing
|
Calling the constructor without any argument creates a path object pointing
|
||||||
to the logical "current directory"::
|
to the logical "current directory" (without looking up its absolute path,
|
||||||
|
which is the job of the ``cwd()`` classmethod on concrete paths)::
|
||||||
|
|
||||||
>>> PurePosixPath()
|
>>> PurePosixPath()
|
||||||
PurePosixPath('.')
|
PurePosixPath('.')
|
||||||
|
|
Loading…
Reference in New Issue