[Python-Dev] type categories

Jeremy Hylton jeremy@alum.mit.edu
Fri, 13 Sep 2002 10:14:49 -0400


>>>>> "DA" == David Abrahams <dave@boost-consulting.com> writes:

  DA> I was going to say that is seems to me if you can dynamically
  DA> inject base classes in Python there's no problem using
  DA> inheritance to do this sort of labelling. However, on third
  DA> though, maybe there is a problem. Suppose you have an
  DA> inheritance chain A->B->C...->Z and I come a long later to say
  DA> that A fulfills interface II and add II to A's bases. Which of
  DA> A's subclasses also fulfill II. I might not know. I might not
  DA> even know about them. For this, maybe you'd need a way to
  DA> express inheritance that goes just "one level deep" (i.e. A
  DA> inherits II publicly, but nothing else does). And that might
  DA> just screw with the notion of inheritance enough that you want a
  DA> separate parallel mechanism.

  DA> So I guess I'm back to where I was before. Inheritance probably
  DA> doesn't work out too well for expressing "satisfies interface".

I had similar third thoughts a couple of weeks ago :-).  So I guess I
agree with you.

Jeremy