Gisle Vanem <gva...@yahoo.no> writes: > That's exactly what they do now in IPython/utils/version.py with > the comment: > Utilities for version comparison > It is a bit ridiculous that we need these. > > Not sure why this is "ridiculous".
Right, versions are effectively a special type [0], specifically *because* they intentionally don't compare as scalar numbers or strings. It's not “ridiculous” to need custom comparisons when that's the case. Python even comes with support for version parsing and comparison in the standard library [1]. So if anything's “ridiculous”, it's the act of re-implementing that and getting it wrong. (Or maybe that such an important part of the standard library is largely undocumented.) [0] <URL:https://wiki.python.org/moin/Distutils/VersionComparison> [1] Unfortunately undocumented, like much of the Distutils API. Try <URL:http://epydoc.sourceforge.net/stdlib/distutils.version.StrictVersion-class.html>. -- \ “Programs must be written for people to read, and only | `\ incidentally for machines to execute.” —Abelson & Sussman, | _o__) _Structure and Interpretation of Computer Programs_ | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list