Version(major, minor, patch) with __eq__ and __lt__ comparing the three numbers lexicographically, decorated with functools.total_ordering so <=, >, >= come free. A list of Versions must sort correctly with plain sorted().Version(1, 10, 0) > Version(1, 9, 9)
True
Numeric tuple comparison: 10 beats 9 in the minor slot.
Compare (major, minor, patch) tuples.
from functools import total_ordering.