@classmethod
def _bind_operator(cls, op):
    """ bind operator to this class """
    name = op.__name__
    if name.endswith('_'):
        name = name[:-1]
    elif name == 'inv':
        name = 'invert'
    meth = '__{0}__'.format(name)
    if name in ('abs', 'invert', 'neg', 'pos'):
        setattr(cls, meth, cls._get_unary_operator(op))
    else:
        setattr(cls, meth, cls._get_binary_operator(op))
        if name in ('eq', 'gt', 'ge', 'lt', 'le', 'ne', 'getitem'):
            return
        rmeth = '__r{0}__'.format(name)
        setattr(cls, rmeth, cls._get_binary_operator(op, inv=True))
