title: Python - Human sort of numbers with alpha numeric, but in pyQt and a __lt__ operator
body: <p>I have data rows and wish to have them presented as follows:</p>
  
  <pre><code>1
  1a
  1a2
  2
  3
  9
  9.9
  10
  10a
  11
  100
  100ab
  ab
  aB
  AB
  </code></pre>
  
  <p>As I am using pyQt and code is contained within a TreeWidgetItem, the code I'm trying to solve is:</p>
  
  <pre><code>def __lt__(self, otherItem):
      column = self.treeWidget().sortColumn()
  
      #return self.text(column).toLower() &lt; otherItem.text(column).toLower()
  
      orig = str(self.text(column).toLower()).rjust(20, "0")
      other = str(otherItem.text(column).toLower()).rjust(20, "0")
      return orig &lt; other
  </code></pre>