On Wed, 26 Sep 2018 at 20:27, Petr Viktorin encukou@gmail.com wrote:
I'd much, much rather explain that
sys.version[2]
is not correct, and solve the "python310" < "python39" problem.
One of the perks of the way PEP 425 deals with this [1] is that ASCII underscores sort higher than ASCII digits, so:
>>> "py31" < "py39" < "py310" < "py311"
False
>>> "py31" < "py39" < "py3_10" < "py3_11"
True
(I'm not sure if that's true for all collation orders, but if we find one where it isn't, then we'd just specify a collation order to use for Python version comparisons)
Cheers, Nick.
[1] https://www.python.org/dev/peps/pep-0425/#python-tag