[Python-ideas] Determine Windows version in platform module

Andrew Barnert abarnert at yahoo.com
Sat Dec 28 04:26:44 CET 2013


On Dec 27, 2013, at 13:36, Skip Montanaro <skip at pobox.com> wrote:

> On Fri, Dec 27, 2013 at 3:09 PM, Andrew Barnert <abarnert at yahoo.com> wrote:
>> So you want to write:
>> 
>>    if platform.win_version_info >= (5, 1, 2600):
>> 
>> Is that really much better than:
>> 
>>    if platform.win32_ver.version >= '5.1.2600':
> 
> Once either of the first two numbers rolls over to two digits, the
> first comparison will be correct, the second will not:
> 
>>>> x = '5.9.2600'
>>>> y = '5.10.2600'
>>>> y > x

Sure, but in decades of Windows versions it's never come even close to rolling over. Other than them renaming NT 3.2 as 3.5, they've never even gotten past .3. So, do you really think you need to worry about that? It seems just as plausible that they'd completely change their versioning scheme as that they'd ever go to 6.10 under the current scheme. Plus, it would be about 15 years away at their historical version numbering rates.


More information about the Python-ideas mailing list