title: python overloading operators
body: <p>I need to implement a DNA class which has attribute a sequence which consists of a string of characters from the alphabet ('A,C,G,T') and I need to overload some operators like less than, greater than, etc..</p>
  <p>here is my code:</p>
  <pre><code>class DNA:
      def __init__(self, sequence):
          self.seq = sequence
  
      def __lt__(self, other):
          return (self.seq &lt; other)
  
      def __le__(self, other):
          return(self.seq &lt;= other)
  
      def __gt__(self, other):
          return(self.seq &gt; other)
  
      def __ge__(self, other):
          return(len(self.seq) &gt;= len(other))
  
      def __eq__(self, other):
          return (len(self.seq) == len(other))
  
      def __ne__(self, other):
          return not(self.__eq__(self, other))
  </code></pre>
  <hr />
  <pre><code>dna_1=DNA('ACCGT')
  dna_2=DNA('AGT')
  print(dna_1 &gt; dna_2)
  </code></pre>
  <p><strong>Problem:</strong></p>
  <p>when I <code>print(dna_1&gt;dna_2)</code> it returns <code>False</code> instead of <code>True</code>... Why?</p>