MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/itzn13/an_update_on_python_4/g5iv0v7
r/Python • u/anyfactor Freelancer. AnyFactor.xyz • Sep 16 '20
389 comments sorted by
View all comments
Show parent comments
2
None of these lists contain versions. Try this one:
from packaging.version import Version versions = [Version(v) for v in ["3.8", "3.9", "3.10"]] assert sorted(versions) == versions
For versions containing only numbers (and not e.g. 3.9b1) you can also think of them as tuples of integers.
3.9b1
0 u/Leav Sep 17 '20 Yes, I understand this is how versions work, but to someone who is not familiar with them, it looks extremely weird and confusing. 1 u/flying-sheep Sep 17 '20 Well, welcome to human language notation. There's things that look similar but aren't the same. Boohoo.
0
Yes, I understand this is how versions work, but to someone who is not familiar with them, it looks extremely weird and confusing.
1 u/flying-sheep Sep 17 '20 Well, welcome to human language notation. There's things that look similar but aren't the same. Boohoo.
1
Well, welcome to human language notation. There's things that look similar but aren't the same. Boohoo.
2
u/flying-sheep Sep 16 '20
None of these lists contain versions. Try this one:
For versions containing only numbers (and not e.g.
3.9b1) you can also think of them as tuples of integers.