Seems like it should exist somewhere, possibly directly in the stdlib?
Also we have a couple of different places in the cython code where we do effectively:
def op_to_op_code(op):
if op is operator.lt:
op_code = Py_LT
elif op is operator.le:
op_code = Py_LE
[...]
return op_code
which seems like it should fit upstream somewhere.
Comment From: jbrockmendel
Suggested this in https://discuss.python.org/t/reversed-ops-in-operator-module/24949/2, the reaction was not positive. Closing.