<div>
                    I was digging through PEP386 & PEP345 today, and I noticed something odd about the wording of PEP345.
                </div><div><br></div><div>It states:</div><div><br></div><div>    When a version is provided, it always includes all versions that starts with the same value. For</div><div>    example the "2.5" version of Python will include versions like "2.5.2" or "2.5.3". Pre and post</div><div>    releases in that case are excluded. So in our example, versions like "2.5a1" are not included</div><div>    when "2.5" is used. If the first version of the range is required, it has to be explicitly given. In</div><div>    our example, it will be "2.5.0".</div><div><br></div><div>It also states:</div><div><br></div><div>    In that case, "2.5.0" will have to be explicitly used to avoid any confusion between the "2.5"</div><div>    notation that represents the full range. It is a recommended practice to use schemes of the</div><div>    same length for a series to completely avoid this problem.</div><div><br></div><div>This effectively translates to an inability to pin to an exact version. Even in the case of specifying</div><div>== it checks that the version "starts with" the value you selected. So if you pin to "2.5", and the</div><div>author then releases "2.5.1", that will count as ==2.5. If you try to then pin to "2.5.0", and the</div><div>author releases "2.5.0.1", then that will count as ==2.5.0.</div><div><br></div><div>Essentially this translates to:</div><div><br></div><div>    ==2.5       -> >=2.5<2.6</div><div>    ==2.5.0    -> >=2.5.0<2.5.1</div><div>    ==2.5.0.0 -> >=2.5.0.0<2.5.0.1</div><div><br></div><div>Which means that version specifiers are _always_ ranges and are never exact versions. The PEP</div><div>as written relies on authors to decide beforehand how many digits they are going to use in their</div><div>versions, and for them to never increase or decrease that number.</div><div><br></div><div>I also checked to see if Distutils2/packaging implemented VersionPredicates that way or if they</div><div>allowed specifying an exact version. It turned out that it implements the PEP as written:</div><div><br></div><div>>>> <span style="font-family: 'Bitstream Vera Sans Mono', Courier, monospace; font-size: 12px; line-height: 16.78333282470703px; text-align: left; white-space: pre; ">from distutils2 import version</span></div><div><span style="font-family: 'Bitstream Vera Sans Mono', Courier, monospace; font-size: 12px; line-height: 16.78333282470703px; text-align: left; white-space: pre; ">>>> predicate = </span><span style="font-family: 'Bitstream Vera Sans Mono', Courier, monospace; font-size: 12px; line-height: 16.78333282470703px; text-align: left; white-space: pre; ">version.VersionPredicate("foo (==2.5)")</span></div><div><span style="font-family: 'Bitstream Vera Sans Mono', Courier, monospace; font-size: 12px; line-height: 16.78333282470703px; text-align: left; white-space: pre; ">>>> print predicate</span></div><div><span style="font-family: 'Bitstream Vera Sans Mono', Courier, monospace; font-size: 12px; line-height: 16.78333282470703px; text-align: left; white-space: pre; ">foo (==2.5)</span></div><div><span style="font-family: 'Bitstream Vera Sans Mono', Courier, monospace; font-size: 12px; line-height: 16.78333282470703px; text-align: left; white-space: pre; ">>>> predicate.match("</span><span style="font-family: 'Bitstream Vera Sans Mono', Courier, monospace; font-size: 12px; line-height: 16.78333282470703px; text-align: left; white-space: pre; ">2.5")</span></div><div><span style="font-family: 'Bitstream Vera Sans Mono', Courier, monospace; font-size: 12px; line-height: 16.78333282470703px; text-align: left; white-space: pre; ">True</span></div><div><span style="font-family: 'Bitstream Vera Sans Mono', Courier, monospace; font-size: 12px; line-height: 16.78333282470703px; text-align: left; white-space: pre; ">>>> predicate.match("2.5.0")</span></div><div><span style="font-family: 'Bitstream Vera Sans Mono', Courier, monospace; font-size: 12px; line-height: 16.78333282470703px; text-align: left; white-space: pre; ">True</span></div><div><span style="font-family: 'Bitstream Vera Sans Mono', Courier, monospace; font-size: 12px; line-height: 16.78333282470703px; text-align: left; white-space: pre; ">>>> predicate.match("2.5.0.0")</span></div><div><span style="font-family: 'Bitstream Vera Sans Mono', Courier, monospace; font-size: 12px; line-height: 16.78333282470703px; text-align: left; white-space: pre; ">True</span></div><div><span style="font-family: 'Bitstream Vera Sans Mono', Courier, monospace; font-size: 12px; line-height: 16.78333282470703px; text-align: left; white-space: pre; ">>>> predicate.mach("2.5.0.5")</span></div><div><span style="font-family: 'Bitstream Vera Sans Mono', Courier, monospace; font-size: 12px; line-height: 16.78333282470703px; text-align: left; white-space: pre; ">True</span></div>
                <div></div>