title: Sort lists of float-like strings
body: <p>I need to sort to the following list:</p>
  
  <pre><code>b = ['0.10', '0.1', '0.11', '0.12', '0.2', '0.3']
  </code></pre>
  
  <p>… so that the output will be:</p>
  
  <pre><code>['0.1', '0.2', '0.3', '0.10', '0.11', '0.12']
  </code></pre>
  
  <p>They look like <code>float</code> values, but that's not the order I want - they need to be treated as if they are version numbers - i.e. 0.1 is not 0.10 (the first is zero dot one, the second is zero dot ten). When I use <code>float</code> as a key, I get a different order:</p>
  
  <pre><code>&gt;&gt;&gt;b.sort(key=float)
  &gt;&gt;&gt;b 
  ['0.10', '0.1', '0.11', '0.12', '0.2', '0.3']
  </code></pre>
  
  <p>I also want to sort the following list:</p>
  
  <pre><code>['3.0.1', '3.0.10', '3.0.11', '3.0.12', '3.0.2', '3.0.3', 
   '3.0.4', '3.0.5', '3.0.6', '3.0.7', '3.0.8', '3.0.9', 
   '3.1.1', '3.1.10', '3.1.11', '3.1.12', '3.1.2', '3.1.3', 
   '3.1.4', '3.1.5', '3.1.6', '3.1.7', '3.1.8', '3.1.9']
  </code></pre>
  
  <p>In this order:</p>
  
  <pre><code>['3.0.1', '3.0.2', '3.0.3', '3.0.4', '3.0.5', '3.0.6',
   '3.0.7', '3.0.8', '3.0.9', '3.0.10', '3.0.11', '3.0.12',
   '3.1.1', '3.1.2', '3.1.3', '3.1.4', '3.1.5', '3.1.6',
   '3.1.7', '3.1.8', '3.1.9', '3.1.10', '3.1.11', '3.1.12']
  </code></pre>