[Python-checkins] peps: `parent` is now a property returning the logical parent of the path

antoine.pitrou python-checkins at python.org
Tue Nov 19 22:01:19 CET 2013


http://hg.python.org/peps/rev/2c57a645cce8
changeset:   5294:2c57a645cce8
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Tue Nov 19 22:01:14 2013 +0100
summary:
  `parent` is now a property returning the logical parent of the path

files:
  pep-0428.txt |  9 +++------
  1 files changed, 3 insertions(+), 6 deletions(-)


diff --git a/pep-0428.txt b/pep-0428.txt
--- a/pep-0428.txt
+++ b/pep-0428.txt
@@ -484,14 +484,11 @@
 
 (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::

-- 
Repository URL: http://hg.python.org/peps


More information about the Python-checkins mailing list