[Python-3000] Implementations: A syntax for extending method dispatching beyond type/class inheritance

Bill Janssen janssen at parc.com
Mon Dec 4 22:28:11 CET 2006

Jim Jewett writes:
> On 12/3/06, Bill Janssen <janssen at parc.com> 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 :-).


More information about the Python-3000 mailing list