On Mon, Dec 22, 2014 at 2:38 PM, Marcus Smith <qwc...@gmail.com> wrote:
> there's a big difference between stating the concept directly/simply in the
> PEP vs readers/users having to reverse engineer it from "prefix based
> version exclusion clause !=
> V.* ."
>
> If this is what it's about, users need to be clearly informed (in the pip
> and PyPUG docs) that "1.7" effectively means "1.7.*" in specifiers.

FWIW, I agree the wording isn't very easy to follow (it reads more
like a technical standard rather than something to educate).  You have
to unwind the logic from a few sections.

By the way, note that "1.7" doesn't *always* mean "1.7.*" (in fact, it
usually doesn't since the default is the "strict" form).  From the
"Version Matching" section:

"By default, the version matching operator is based on a strict
equality comparison: the specified version must be exactly the same as
the requested version. The only substitution performed is the zero
padding of the release segment to ensure the release segments are
compared with the same length.

"Whether or not strict version matching is appropriate depends on the
specific use case for the version specifier. Automated tools SHOULD at
least issue warnings and MAY reject them entirely when strict version
matches are used inappropriately.

"Prefix matching may be requested instead of strict comparison, by
appending a trailing .* to the version identifier in the version
matching clause."

--Chris




>
> On Mon, Dec 22, 2014 at 1:31 PM, Chris Jerdonek <chris.jerdo...@gmail.com>
> wrote:
>>
>> On Mon, Dec 22, 2014 at 1:03 PM, Marcus Smith <qwc...@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.
>>
>> --Chris
>
>
_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to