title: operator python parameter
body: <p>In Python, how can I pass an operator like <code>+</code> or <code>&lt;</code> as a parameter to a function which expects a comparison function as a parameter?</p>
  
  <pre><code>def compare (a,b,f):
      return f(a,b)
  </code></pre>
  
  <p>I have read about functions like <code>__gt__()</code> or <code>__lt__()</code> but still I was not able to use them.</p>