
Yes, JOM is right, again ... 
Thanks to foreseen the mistake.
But I think both approach have problems, in different situations:
Code:
>>> "2.10">"2.4"
False
But, I know, if we want just to check 1.x against 2.y, a simple string comparison is enough, as indicated by JOM. This seemed a simple question ...
In my code (wordmobi), I defined versions like x.y.z, I mean, 3 numbers separated by ".". Each number with one or two digits. And I used this function:
Code:
def ver2num(ver):
a,b,c = map(lambda x,y: x*y, [10000,100,1],[int(v) for v in ver.split(".")])
return a+b+c
An integer is returned but it costs a lot to process ...