Jim Jewett writes: > On 12/3/06, Bill Janssen <[EMAIL PROTECTED]> wrote: > > > Implementations are used to make Method Dispatching more flexible by > > > allowing a class to claim that it acts like another class/type even > > > though it is not derived from that class/type. > > > I'm not sure just what this adds over the simple "change_class" > > function that I've posted twice already. Is there an implementation > > efficiency argument here? > > (1) Interfaces can be placed on a separate (presumably light-weight) > inheritance hierarchy.
I know it looks this way, but I think you'd just be changing one inheritance mechanism for another. No one would use the one that's already there; they'd just use this one instead. And I don't really see how it's lighter-weight -- can you explain that? > (2) There is are efficiency (and security) concerns with changing > bases in an arbitrary manner. Changing them only at the back (where > they cannot hide existing attributes) may be safer and easier. (I'm > not certain of this; but I'm not ready to rule it out either.) I'm not sure how this is supposed to work, though, without changing bases. I started to write up a sentence much like you wrote above, then didn't, because I couldn't see how you could do this without changing bases. But Dave has still only provided a sketch. He hasn't explained how it works yet, so we could both be right :-). Bill _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
