I want to write a cmp-like function which compares two version numbers and returns -1, 0, or 1 based on their compared va
cmp
-1
0
1
Is reuse considered elegance in this instance? :)
# pkg_resources is in setuptools # See http://peak.telecommunity.com/DevCenter/PkgResources#parsing-utilities def mycmp(a, b): from pkg_resources import parse_version as V return cmp(V(a),V(b))