It would be nice to have reversed operations available in the stdlib operator module, e.g.
def radd(x, y):
return y + x
This is easy to implement as e.g. a lambda, but that causes problems when you need to check something like if op is operator.eq: which is a pattern that shows up frequently in dispatching code.
Why would it be ‘nice’, especially when you can trivially implement such?
The operator module exposes the C functions that implement the operators. Each C function calls the normal and reversed dunder methods as appropriate. There are no reversed functions to expose.
IOW, a+b is compiled, in CPython, to a binary add functions that may call either a.__add__(b) or b.__radd__(a) or both as appropriate and necessary.