[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 14:17:26 CET 2013


On Tue, Feb 26, 2013 at 10:08 PM, Michael Foord <fuzzyman at gmail.com> wrote:
> The current tools are strict with regards to equality - and in dependency
> pinning I would see it as *surprising* that specifying "==1.3" installs some
> version that isn't precisely 1.3. Having "==" mean approximately-equal,
> instead of the-same-as, seems like a mistake to me.

The most palatable alternative I've seen so far is for a trailing ".*"
to trigger prefix matching for == and != (it would be disallowed for
anything else). It's *slightly* odd, because the "." is implied rather
than explicit for alphas, betas and release candidates (a choice
driven by the weight of existing practice on PyPI, as well as
CPython's own conventions), but it's probably still a better idea than
trying to change the meaning of "==".

I *don't* like the idea of (== 1.3) and (== 1.3.0) being equivalent
when (1.3) and (1.3.0) are substantially different, though. Instead,
I'll reinstate a variant of the commentary from PEP 386 that pointed
out the value of always publishing releases with a consistent number
of components by including the trailing ".0".

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Distutils-SIG mailing list