[issue12158] platform: add linux_version()

Marc-Andre Lemburg report at bugs.python.org
Mon May 23 15:11:27 CEST 2011


Marc-Andre Lemburg <mal at egenix.com> added the comment:

STINNER Victor wrote:
> 
> STINNER Victor <victor.stinner at haypocalc.com> added the comment:
> 
>> The returned value should be a version string in a fixed format,
>> not a tuple. I'd suggest to use _norm_version() for this.
> 
> How do you compare version strings? I prefer tuples, as sys.version_info, because the comparaison is more natural:
> 
>>>> '2.6.9' > '2.6.20'
> True
>>>> (2, 6, 9) > (2, 6, 20)
> False

The APIs are mostly used for creating textual representations
of system information, hence the use of strings.

You can add an additional linux_version_info() API if you want to
have tuples.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12158>
_______________________________________


More information about the Python-bugs-list mailing list