[issue40004] String comparison with dotted numerical values wrong

2020-03-18 Thread Guido van Rossum
Guido van Rossum added the comment: That's a question for a user forum. There's some code in Lib/distutils/version.py. -- ___ Python tracker ___ _

[issue40004] String comparison with dotted numerical values wrong

2020-03-18 Thread Boštjan Mejak
Boštjan Mejak added the comment: What is then the most Pythonic way of comparing two version numbers? -- ___ Python tracker ___ ___

[issue40004] String comparison with dotted numerical values wrong

2020-03-18 Thread Guido van Rossum
Guido van Rossum added the comment: That's why for over a decade we've been recommending not to use string comparisons to compare versions. You have to parse the version and then compare the numeric values. -- resolution: -> not a bug stage: -> resolved status: open -> closed

[issue40004] String comparison with dotted numerical values wrong

2020-03-18 Thread Boštjan Mejak
New submission from Boštjan Mejak : I stumbled upon a possible bug in the Python interpreter while doing some Python version comparisons. Look at this: "3.10.2" < "3.8.2" True # This is not true as a version number comparison Now look at this: "3.10.2" < "3.08.2" False # Adding a leading 0 c