[Distutils] [Python-Dev] [Python-checkins] peps: PEP 426: replace implied 'version starts with' with new ~= operator
Nick Coghlan
ncoghlan at gmail.com
Tue Feb 26 17:15:56 CET 2013
On Wed, Feb 27, 2013 at 2:07 AM, Daniel Holth <dholth at gmail.com> wrote:
> With "prefix equals" would the following evaluate to true?
>
> 1.4 == 1 == 1.3.1
I guess that's the other advantage of the wildcard notation - it makes
it very clear something special is going on :)
For the ".0" expansion, I like Donald's explanation that when two
numbers with an uneven number of components are compared with == or
!=, the shorter one is expanded with ".0" elements until they have the
same number.
That gives the following comparison clauses:
Compatible version: some-dist (X.Y) # Expects (>= X.Y, < X+1.dev0)
Wildcard version: some-dist (== X.Y.*) # Expects (>= X.Y, < X.Y+1.dev0)
Exact version: some-dist (== X.Y) # Expects X.Y, allows extra ".0" suffixes
I can live with that.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Distutils-SIG
mailing list