[Python-checkins] peps: PEP 426: trailing 0's policy for ==

daniel.holth python-checkins at python.org
Sun Mar 10 19:33:17 CET 2013


http://hg.python.org/peps/rev/ae5d9b9df1a6
changeset: 4792:ae5d9b9df1a6
user: Daniel Holth <dholth at fastmail.fm>
date: Sun Mar 10 14:32:53 2013 -0400
summary:
 PEP 426: trailing 0's policy for ==
files:
 pep-0426.txt | 24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/pep-0426.txt b/pep-0426.txt
--- a/pep-0426.txt
+++ b/pep-0426.txt
@@ -601,9 +601,11 @@
 
 .. note::
 
- Some hard to read version identifiers are permitted by this scheme
- in order to better accommodate the wide range of versioning practices
- across existing public and private Python projects.
+ Some hard to read version identifiers are permitted by this scheme in
+ order to better accommodate the wide range of versioning practices
+ across existing public and private Python projects, given the
+ constraint that the package index is not yet sophisticated enough to
+ allow the introduction of a simpler, backwards-incompatible scheme.
 
 Accordingly, some of the versioning practices which are technically
 permitted by the PEP are strongly discouraged for new projects. Where
@@ -1059,17 +1061,17 @@
 The ordered comparison operators ``<``, ``>``, ``<=``, ``>=`` are based
 on the consistent ordering defined by the standard `Version scheme`_.
 
-The ``==`` and ``!=`` operators are based on string comparisons - in order
-to match, the version being checked must start with exactly that sequence of
-characters.
+The ``==`` and ``!=`` operators are based on a kind of prefix comparison -
+trailing ``0``s are implied when comparing numeric version parts of different
+lengths. ``1.0 == 1 == 1.0.0``, and ``1.0a1 == ``1.0.0.0a1``.
 
 .. note::
 
- The use of ``==`` when defining dependencies for published distributions
- is strongly discouraged, as it greatly complicates the deployment of
- security fixes (the strict version comparison operator is intended
- primarily for use when defining dependencies for particular
- applications while using a shared distribution index).
+ The use of ``==`` when defining dependencies for published
+ distributions is strongly discouraged as it greatly complicates the
+ deployment of security fixes. The strict version comparison operator
+ is intended primarily for use when defining dependencies for repeatable
+ *deployments of applications* while using a shared distribution index.
 
 
 Handling of pre-releases
-- 
Repository URL: http://hg.python.org/peps


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /