Add a couple clarifications

This commit is contained in:
Antoine Pitrou 2012-10-06 01:17:59 +02:00
parent 47e356c506
commit 44fa1d5fe1
1 changed files with 12 additions and 1 deletions

View File

@ -291,6 +291,14 @@ Extraneous path separators and ``"."`` components are eliminated, but not
>>> 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
to the logical "current directory"::
@ -309,10 +317,13 @@ A path can be joined with another using the ``__getitem__`` operator::
>>> p[PurePosixPath('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']
PurePosixPath('foo/bar/xyzzy')
>>> p['bar', 'xyzzy']
PurePosixPath('foo/bar/xyzzy')
A join() method is also provided, with the same behaviour. It can serve
as a factory function::