Add a couple clarifications
This commit is contained in:
parent
47e356c506
commit
44fa1d5fe1
13
pep-0428.txt
13
pep-0428.txt
|
@ -291,6 +291,14 @@ Extraneous path separators and ``"."`` components are eliminated, but not
|
||||||
>>> PurePosixPath('a/../b')
|
>>> PurePosixPath('a/../b')
|
||||||
PurePosixPath('a/../b')
|
PurePosixPath('a/../b')
|
||||||
|
|
||||||
|
Multiple leading slashes are treated differently depending on the path
|
||||||
|
flavour::
|
||||||
|
|
||||||
|
>>> PurePosixPath('//some/path')
|
||||||
|
PurePosixPath('/some/path')
|
||||||
|
>>> PureNTPath('//some/path')
|
||||||
|
PureNTPath('\\\\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"::
|
||||||
|
|
||||||
|
@ -309,10 +317,13 @@ A path can be joined with another using the ``__getitem__`` operator::
|
||||||
>>> p[PurePosixPath('bar')]
|
>>> p[PurePosixPath('bar')]
|
||||||
PurePosixPath('foo/bar')
|
PurePosixPath('foo/bar')
|
||||||
|
|
||||||
As with constructing, multiple path components can be specified at once::
|
As with constructing, multiple path components can be specified, either
|
||||||
|
collapsed or separately::
|
||||||
|
|
||||||
>>> p['bar/xyzzy']
|
>>> p['bar/xyzzy']
|
||||||
PurePosixPath('foo/bar/xyzzy')
|
PurePosixPath('foo/bar/xyzzy')
|
||||||
|
>>> p['bar', 'xyzzy']
|
||||||
|
PurePosixPath('foo/bar/xyzzy')
|
||||||
|
|
||||||
A join() method is also provided, with the same behaviour. It can serve
|
A join() method is also provided, with the same behaviour. It can serve
|
||||||
as a factory function::
|
as a factory function::
|
||||||
|
|
Loading…
Reference in New Issue