No, Date.__div__ sees the swapped flag and knows that the unswapped
operation has already been tried.
In general I'm wary of routines that take flags (such as 'swapped')
that really mean "use a different version of the function" -- these
flags are almost always passed from constants and so it would be more
efficient to have a second name for the variant function.
So my counter proposal would be to define __rbinop__ for every binop
where the RHS wants control. Note that for reflexive binop, adding
__rbinop__ = __binop__ to the class is sufficient. The RHS dispatch
case would then be reduced to a single lookup as well.
--Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
URL: <http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>