title: Sort Versions in Python
body: <p>I'm trying to get it so that 1.7.0 comes after 1.7.0.rc0 but before 1.8.0, as it should if you were sorting versions. I thought the whole point of LooseVersion was that it handled the sorting and comparison of this kind of thing correctly.</p>
  
  <pre><code>&gt;&gt;&gt; from distutils.version import LooseVersion
  &gt;&gt;&gt; versions = ["1.7.0", "1.7.0.rc0", "1.8.0"]
  &gt;&gt;&gt; lv = [LooseVersion(v) for v in versions]
  &gt;&gt;&gt; sorted(lv, reverse=True)
  [LooseVersion ('1.8.0'), LooseVersion ('1.7.0.rc0'), LooseVersion ('1.7.0')]
  </code></pre>