[Python-checkins] peps: Assorted comments by Jim Jewett
antoine.pitrou
python-checkins at python.org
Wed Nov 20 00:46:44 CET 2013
http://hg.python.org/peps/rev/39106c2eb5a1
changeset: 5297:39106c2eb5a1
user: Antoine Pitrou <solipsis at pitrou.net>
date: Wed Nov 20 00:46:39 2013 +0100
summary:
Assorted comments by Jim Jewett
files:
pep-0428.txt | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/pep-0428.txt b/pep-0428.txt
--- a/pep-0428.txt
+++ b/pep-0428.txt
@@ -155,8 +155,8 @@
if you want a path to act as a sequence, you have to lookup a dedicated
attribute (the ``parts`` attribute).
-By avoiding to pass as builtin types, the path classes minimize the potential
-for confusion if they are combined by accident with genuine builtin types.
+Not behaving like one of the basic builtin types also minimizes the potential
+for confusion if a path is combined by accident with genuine builtin types.
Immutability
@@ -201,6 +201,9 @@
File "<stdin>", line 1, in <module>
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
----------------
@@ -315,7 +318,8 @@
PurePosixPath('//some/path')
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('.')
--
Repository URL: http://hg.python.org/peps
More information about the Python-checkins
mailing list