Map comparison operators to function call
<p>I'm building a DSL for form validation in Python, and one of the requirements is to be able to specify that a field should be greater than or less than a constant or another field value. As a result, I'm trying to easily map operators like <code>&lt;</code>, <code>&gt;</code>, <code>&lt;=</code> and <code>&gt;=</code> to their equivalent functions in the <code>operator</code> module, so that they can be called during field validation.</p>

<p>I realise I could just create a dictionary to map the operator to the function, but is there a nicer way to do it? Is there any way to access Python's built-in mapping?</p>
