[Types-sig] Why have two hierarchies? (*EUREKA!*)

Just van Rossum just@letterror.com
Sat, 5 Dec 1998 14:42:54 +0100


Here's one additional remark that I forgot to put in the article.

The meta classes issue comes from this question:

    If an object has a class (a __class__ attribute), the what is
    the class of the object's class?

My (current ;-) solution to this infinite recursion can be summarized thusly:

Today, instances have a __class__, and classes have base classes. Instead
of adding a __class__ attribute to classes, we should get rid of the
__class__ attribute of instances and give them __bases__ instead. So
instead of _adding_ a layer of complexity (meta classes) I _remove_ one.

Python today:

    instance.__class__.__bases__

I suggest:

    instance.__bases__

Ok, enough already. Let the hangman come!

Just