[Python-Dev] Operator overloading inconsistency (bug or feature?)
Thu, 8 Aug 2002 08:46:47 -0500 (CDT)
Suppose that a new-style class wants to overload "*" and it
defines two methods like this:
Python-2.2.1, if you try this, you get the following behavior:
>>> f = Foo()
So here is the question: Why does the last statement in this example
not invoke __rmul__? In other words, why do "1.0*f" and "1*f" produce
different behavior. Is this intentional? Is this documented someplace?
Is there a workaround? Or are we just missing something obvious?