title: overloading less than in python
body: <p>I've been fiddling with overloading operators in python and I've come across a question.</p>
  
  <p>So I have a class that has values in which I want to use for a comparison.</p>
  
  <pre><code>class comparison:
  
      def __init__(self, x):
          self.x = x
  
      ...
  
      def __lt__(self,other): 
          return self.x &lt; other
  </code></pre>
  
  <p>which overloads the operator for less than. I made conditions on other such as what type it must be. </p>
  
  <p>An example would be </p>
  
  <pre><code>x = comparison(2)
  x &lt; 1 #--&gt; False
  x &lt; 3 #--&gt; True
  </code></pre>
  
  <p>My question would be how could I check on the first part of the comparison?
  I'm trying to limit the first part to something specific.</p>
  
  <p>An example would be </p>
  
  <pre><code>7 &lt; x # --&gt; I don't want the first one to be an int
  </code></pre>