Say I have two Python classes which both define the add and radd operator overloads, and I add one instance of one class to another instance of another class. The chosen implementation depends on the order in which the items are added (Python looks for an add method on the LHS first, etc).
Is it possible for me to define a precedence on which object's implementation is preferred? I want, for example, that radd is called on the RHS if its precedence is higher than that of the LHS.
I really want to do this for all overloaded operators, so a more general solution is what I'm eventually after.
[edit: added example]
For example, I may have a custom number type class, and I might wish to silently typecast ints to my custom type. Hence I need add and radd (and all the other operator overloads with their 'r' cousins).
Next, I want a generic polynomial class, whose coefficients are some generic number type. I also want to typecast things to polynomials, so I implement add and radd functions for it. However, if I add a custom number on the left with and a polynomial on the right, I want it to be typecast up to a polynomial instead of Python trying to typecast it down to a custom number type. Hence, I want radd to be called instead of add.
__radd__methods, in that if you do3 + MyCustomInt(), your custom class's__radd__will indeed be called. If I understand right, the essence of your question is that you want to be able to do the same thing with your custom classes.