'produce a generic operator function.
e.g.::
somecolumn.op("*")(5)
produces::
somecolumn * 5
This function can also be used to make bitwise operators explicit. For
example::
somecolumn.op(\'&\')(0xff)
is a bitwise AND of the value in ``somecolumn``.
:param operator: a string which will be output as the infix operator
between this element and the expression passed to the
generated function.
:param precedence: precedence to apply to the operator, when
parenthesizing expressions.  A lower number will cause the expression
to be parenthesized when applied against another operator with
higher precedence.  The default value of ``0`` is lower than all
operators except for the comma (``,``) and ``AS`` operators.
A value of 100 will be higher or equal to all operators, and -100
will be lower than or equal to all operators.
.. versionadded:: 0.8 - added the \'precedence\' argument.
:param is_comparison: if True, the operator will be considered as a
"comparison" operator, that is which evaulates to a boolean true/false
value, like ``==``, ``>``, etc.  This flag should be set so that
ORM relationships can establish that the operator is a comparison
operator when used in a custom join condition.
.. versionadded:: 0.9.2 - added the :paramref:`.Operators.op.is_comparison`
flag.
.. seealso::
:ref:`types_operators`
:ref:`relationship_custom_operator`'

def op(self, opstring, precedence=0, is_comparison=False):

    operator = custom_op(opstring, precedence, is_comparison)
    def against(other):
        return operator(self, other)
    return against
