`parent` is now a property returning the logical parent of the path

This commit is contained in:
Antoine Pitrou 2013-11-19 22:01:14 +01:00
parent 046c7012df
commit c7f8d92125
1 changed files with 3 additions and 6 deletions

View File

@ -484,14 +484,11 @@ Windows paths handle the drive and the root as a single path component::
(separating them would be wrong, since ``C:`` is not the parent of ``C:\\``).
The ``parent()`` method returns an ancestor of the path::
The ``parent`` property returns the logical parent of the path::
>>> p.parent()
>>> p = PureWindowsPath('c:/python33/bin/python.exe')
>>> p.parent
PureWindowsPath('c:/python33/bin')
>>> p.parent(2)
PureWindowsPath('c:/python33')
>>> p.parent(3)
PureWindowsPath('c:/')
The ``parents`` property returns an immutable sequence of the path's
logical ancestors::