Multimethods 101 (was Re: Multiple dispatch (Re: Q: Python 2.0 preliminary features?))
Robin Becker
robin at jessikat.demon.co.uk
Fri Oct 29 07:30:54 EDT 1999
In article <381A421D.D8C8E22F at bigfoot.com>, Louis Madon
<madonl at bigfoot.com> writes
>
...
I'm a bit confused here after seeing the argument presented as a
function of only two types. Say I implement + for floats and then Tim
does it for rationals then in terms of functional mappings + has 2
inputs and one output ie 3 possible types are involved.
Thus my take is that we have
f f and r r
f + r +
after the combination we have
f f r and r f r
f+ . f. .
r. . r. +
so to my way of thinking to fill in we seem to have to modify the
existing operators or provide the mapping f-->r or r-->f
--
Robin Becker
More information about the Python-list
mailing list