[Python-3000] Generic functions vs. OO

Gustavo Niemeyer gustavo at niemeyer.net
Thu Nov 23 21:02:11 CET 2006


> At 10:14 AM 11/23/2006 -0200, Gustavo Niemeyer wrote:
> >This is true for generic functions as well, except that
> >instead of using an IFruit interface, you have a fruit()
> >generic function which handles the adaptation.  Unfortunately,
> >this model doesn't work with more complex hierachies.
> 
> You've got that backwards, actually; generic functions can work with
> "recombinant" hierarchies, where traditional interfaces can't.  See
> Guido's repost of my explanation under the "Generic functions vs OO"
> thread.  In it, I present a short "Interface" implementation based on

Nonsense.  Coming up with an interface implementation that
includes generic functions makes the point that interfaces are
important stronger, and thus reinforce what I just said.  I never
said generic functions are bad or non-useful, I said that they're
limited and won't work in more complex cases without additional
infrastructure.

-- 
Gustavo Niemeyer
http://niemeyer.net


More information about the Python-3000 mailing list