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 generic functions that provides universal adaptation for arbitrary interface hierarchies, including subset interfaces -- *without having to write adapter classes*: http://mail.python.org/pipermail/python-3000/2006-November/004746.html _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com