MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/itzn13/an_update_on_python_4/g5jt8td/?context=3
r/Python • u/anyfactor Freelancer. AnyFactor.xyz • Sep 16 '20
389 comments sorted by
View all comments
Show parent comments
8
Why?
-3 u/Leav Sep 16 '20 Because 3.10 = "3.1 with more precision" to engineers and scientists and basically all non-developer users.How would python sort these lists: [3.8,3.9,3.10] or ["3.8","3.9","3.10"]? 14 u/Karnyl Sep 16 '20 If you used a library aware of how versions should be sorted, like semver or distutils.version, then they would be sorted correctly.>>> from distutils.version import LooseVersion>>> versions = ["3.8","3.9","3.10"]>>> sorted(versions, key=LooseVersion)"3.8","3.9","3.10" 0 u/Leav Sep 17 '20 Sure, but to newbies this is confusing and non intuitive, that's all we're saying here.No one is saying this is wrong or should change.
-3
Because 3.10 = "3.1 with more precision" to engineers and scientists and basically all non-developer users.
How would python sort these lists: [3.8,3.9,3.10] or ["3.8","3.9","3.10"]?
14 u/Karnyl Sep 16 '20 If you used a library aware of how versions should be sorted, like semver or distutils.version, then they would be sorted correctly.>>> from distutils.version import LooseVersion>>> versions = ["3.8","3.9","3.10"]>>> sorted(versions, key=LooseVersion)"3.8","3.9","3.10" 0 u/Leav Sep 17 '20 Sure, but to newbies this is confusing and non intuitive, that's all we're saying here.No one is saying this is wrong or should change.
14
If you used a library aware of how versions should be sorted, like semver or distutils.version, then they would be sorted correctly.
>>> from distutils.version import LooseVersion>>> versions = ["3.8","3.9","3.10"]>>> sorted(versions, key=LooseVersion)"3.8","3.9","3.10"
>>> from distutils.version import LooseVersion
>>> versions = ["3.8","3.9","3.10"]
>>> sorted(versions, key=LooseVersion)
"3.8","3.9","3.10"
0 u/Leav Sep 17 '20 Sure, but to newbies this is confusing and non intuitive, that's all we're saying here.No one is saying this is wrong or should change.
0
Sure, but to newbies this is confusing and non intuitive, that's all we're saying here.
No one is saying this is wrong or should change.
8
u/Jethro_Tell Sep 16 '20
Why?