[ANN] Multimethod.py -- multimethods for Python

Martin von Loewis loewis at informatik.hu-berlin.de
Wed Jan 12 14:41:02 EST 2000


Doug Hellmann <doughellmann at home.com> writes:

> How is this different from function overloading, as implemented in C++? 
> I'm not a C++  user, but my impression is the effect would be the same. 
> Is that the point?

No. Function overloading in C++ is a static thing. You look at the
static types, and at all statically visible methods, and then chose
the "best" one (in C++, this considers conversions from argument types
to parameter types as well).

In multi-methods, lookup is dynamic. You don't do anything statically,
but defer all decisions to run-time. Then, you care only about the
dynamic types of the arguments.

Regards,
Martin



More information about the Python-list mailing list