[Distutils] PEP440: foo-X.Y.Z does not satisfy "foo>X.Y"?

Chris Jerdonek chris.jerdonek at gmail.com
Mon Dec 22 22:31:39 CET 2014

On Mon, Dec 22, 2014 at 1:03 PM, Marcus Smith <qwcode at gmail.com> wrote:
> This makes sense if you view "1.7" as encompassing all of the releases
>> 1.7.0, 1.7.1, 1.7.2, etc. (and their variants).  It's a bit like the
>> "significant digits" of a number. [1]  You want the release to be
>> bigger than all releases of that type.
> but is this really the underlying concept?
> Does the PEP explain this as a justification? Where?

I think so.  I just read that part of the PEP.

In the section "Exclusive ordered comparison," it says, "the
comparison operators are < and > and the clause MUST be effectively
interpreted as implying the prefix based version exclusion clause !=
V.* ."

The key here is the reference to "prefix based" version exclusion (as
opposed to "strict" version matching).  If I understand correctly,
this says that when "1.7.2" should be compared with "1.7" for
equality, it should be compared with "1.7.*" as opposed to "1.7.0".
This is described in the "Version matching" section.

The prefix-based ".*" notation encapsulates what I said above about
how  "1.7" can be viewed as encompassing all of the releases 1.7.0,
1.7.1, etc.


More information about the Distutils-SIG mailing list