[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: module _VERSION number scheme proposal
- From: David Manura <dm.lua@...>
- Date: Wed, 9 Nov 2011 00:42:22 -0500
On Tue, Nov 8, 2011 at 11:35 PM, HyperHacker <firstname.lastname@example.org> wrote:
> On Tue, Nov 8, 2011 at 21:19, Miles Bader <email@example.com> wrote:
>> I think a simple "version_compare" function (version_greater, whatever)
>> would be more straight-forward; indeed, something like that already
>> exists in GNU libc -- strverscmp. The basic idea is: compare
>> lexigraphically, but compare any embedded integers as numbers.
> Isn't that generally called natural compare? It's used by smart file
> browsers too so that file10.jpg doesn't list before file2.jpg.
Looks so . If the comparison function we use for _VERSION is also
useful for natural order comparisons in general, that would be a plus.
One thing this will not always handle, unlike that Python scheme ,
is pre-release tags  like '5.2.0-beta1 < 5.2.0'. Personally, I've
been moving away from using those to instead putting the stability
level *after* the version: '22.214.171.124 > 126.96.36.199rc > 188.8.131.52b > 184.108.40.206b
> 220.127.116.11a'. This keeps version comparisons simpler (and also allows
reverting back to beta, 18.104.22.168b, if need be).