podhmo / python-node-semver

python version of node-semver
MIT License
21 stars 15 forks source link

Add sort key function #14

Closed vidartf closed 6 years ago

vidartf commented 6 years ago

Comparison functions are not supported for sorting in Python 3. Python 3 instead requires a key function. This PR implements such a key function, and additionally adds unit tests for the sort() and rsort() functions. It also exposes the key functions such that consumers can pass this e.g. to sorted() (i.e. for out of place sorting).

podhmo commented 6 years ago

Exactly. Thank you for PR. I'll merge it.

podhmo commented 6 years ago

0.3.0 is released (pypi)