[Python-Dev] version compare function into main lib
M.-A. Lemburg
mal at egenix.com
Fri Mar 27 17:08:27 CET 2009
On 2009-03-27 17:01, Eric Smith wrote:
> Martin v. Löwis wrote:
>>> Correct me if I wrong, but shouldn't Python include function for
>>> version comparisons?
>>
>> On the packaging summit yesterday, people agreed that yes, we should
>> have something like that in the standard library, and it should be more
>> powerful than what distutils currently offers.
>
> Yes.
>
>> There was no conclusion of how specifically that functionality should
>> be offered; several people agreed that Python should mandate a standard
>> format, which it is then able to compare. So you might not be able to
>> spell it "10.3.40-beta", but perhaps "10.3.40b1" or "10.3.40~beta".
>
> I got the impression that people are generally happy with what
> setuptools provides for version parsing and comparison.
>
> Does anyone think that's not a good model?
Instead of trying to parse some version string, distutils should
require defining the version as tuple with well-defined entries -
much like what we have in sys.version_info for Python.
The developer can then still use whatever string format s/he wants.
The version compare function would then work on this version tuple
and probably be called cmp() (at least in Python 2.x ;-).
--
Marc-Andre Lemburg
eGenix.com
Professional Python Services directly from the Source (#1, Mar 27 2009)
>>> Python/Zope Consulting and Support ... http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
________________________________________________________________________
2009-03-19: Released mxODBC.Connect 1.0.1 http://python.egenix.com/
::: Try our new mxODBC.Connect Python Database Interface for free ! ::::
eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
http://www.egenix.com/company/contact/
More information about the Python-Dev
mailing list