title: Python comparison operator overloading
body: <p>For my Python 2.7.3 project I have a class called <code>custom_date</code>, which has a property called <code>fixed_date</code>:</p>
  
  <pre><code>from datetime import date
  class custom_date():
      def __init__(self, fixed_date):
          self.fixed_date = fixed_date
  
      def __lt__(self, other):
          return self.fixed_date &lt; other
  
      #__gt__, __ge__, __le__, __eq__, __ne__ all implemented the same way
  </code></pre>
  
  <p>My idea is to be able to directly compare <code>custom_date.fixed_date</code> with the builtin <code>date</code>.</p>
  
  <p><strong>Problem</strong> </p>
  
  <p>If I compare a <code>custom_date</code> object to a <code>date</code> object, it's fine. However, if I compare a <code>date</code> object to a <code>custom_date</code>, it returns a <code>TypeError</code></p>
  
  <pre><code>&gt;&gt;&gt; from datetime import date
  &gt;&gt;&gt; x = custom_date(date(2013,2,1))
  &gt;&gt;&gt; y = date(2013,2,2)
  &gt;&gt;&gt; x &gt; y
  False
  &gt;&gt;&gt; y &gt; x
  TypeError: can't compare datetime.date to instance 
  </code></pre>
  
  <p>Is there any way around this?</p>