[Distutils] PEP440: >1.7 vs >=1.7

Donald Stufft donald at stufft.io
Mon Dec 29 20:12:57 CET 2014

> On Dec 29, 2014, at 2:09 PM, Chris Jerdonek <chris.jerdonek at gmail.com> wrote:
> On Mon, Dec 29, 2014 at 12:01 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
>> * for those cases (like date-based versions) where excluding releases with
>> an additional numeric suffix is the right thing to do, an explicit prefix
>> exclusion will still be possible, and will have the advantage of failing
>> noisily on older versions of pip and easy_install, rather than silently
>> installing an unexpected version (which is what will happen for anyone that
>> starts relying on the current explicit exclusion in PEP 440). It's also
>> possible to replace the exclusive bound with an inclusive bound that has the
>> last release segment component incremented.
> Just to confirm, in each of the below is it true that the two
> comparisons are exactly equivalent (taking into account pre-release
> and post-release rules, etc)?
> 1) >V.N.* and >=V.N+1
> 2) <=V.N.* and <V.N+1
> And these two should be even easier:
> 3) <V.* and <V
> 4) >=V.* and >=V
> With the way the PEP is written, it's not completely obvious to me
> that these are true.
> Thanks,
> --Chris

The .* operator is not currently allowed other than in == and != in PEP 440,
that was just a suggestion of a possible future enhancement to make it easier
to get the behavior that people likely want for date based releases. Currently
with the suggested updates to PEP 440 they'd need to do something like >V,!=V.*
to get that behavior.

Donald Stufft
PGP: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA

More information about the Distutils-SIG mailing list