Add check for platform.python_version_tuple
domdfcoding opened this issue · 3 comments
domdfcoding commented
I have observed code using platform.python_version_tuple
to check version numbers, but since it is a tuple of strings it gets tripped up by Python 3.10:
>>> platform.python_version_tuple()
('3', '10', '0a3')
>>> platform.python_version_tuple() > ("3", "3")
False
>>> "10" > "3"
False
>>> platform.python_version_tuple()
('3', '8', '5')
>>> platform.python_version_tuple() > ("3", "3")
True
>>>
>>> "8" > "3"
True
Would you be interested in having a check for this?
asottile commented
yeah looks like this should never be used in comparisons -- would you like to make a PR?
asottile commented
closing => archiving