[Types-sig] Why have three hierarchies? (*BOOM*)
Just van Rossum
Mon, 7 Dec 1998 22:21:11 +0100
Donald ["The Hook"] Beaudry wrote:
>But, what I unsuccesfully tried to point out in my last message was
>that all you are doing is renaming things. You've proposed that what
>we now call __class__ should be called __bases__ and what we now call
>__dict__ should be called __namespace__. You then proposed that we
>stop referring to classes and metaclasses as such and simply refer to
>them as instances. I dont think that this renaming buys us anything.
(I also noted that the choice for the name __namespace__ quite is
arbitrary: I just can't use __dict__ since anything stored in it will be
found by the current Python machinery before my own getattr is ever
invoked. And I just realized that __bases__ should be called __classes__.)
Naming issues aside, when we merge __class__ and __bases__ into one thing,
what could possibly be the meta class but the content of the mergee? Maybe
it's a cheap shot, but in my view it killed pretty effectively ;-). Ok,
that was excellent evidence proving my skull is very thick (not that that
prevents it from exploding, though).
Seriously, maybe you're right. If I read you correctly, the meta object of
my objects is really their builtin definition/implementation. But: if we
have only *one* of these meta objects, and we make it very versatile, there
should be no reason to redefine (ie. to subclass) it from Python. Maybe it
doesn't even need to be accessible from Python. Maybe it's not even a real
object. Maybe that's good: that way we can maybe keep implementation
details out of the language definition. Maybe that's just naive.
>I do like the idea that classes become more like instances
>but I see no need for eliminating the term 'class'.
I don't make classes more like instances, I make instances more like
classes (and that might even be the crux of my rant). And of course the
term class is not ready for the recycling bin. I have my doubt about the
word "meta class" though ;-).
[ ... ]
>To be honest, I dont even understand the subject line in this thread.
>What are these two hierarchies anyways? Are you referring to the type
>vs class hierarchies or the meta vs non-meta hierarchies? Personally,
>I dont belive in the need for either of these splits.
Well, you've created it yourself ;-). Maybe it's not really there, but
that's where my proposal kicks in: it is *really* not there... Seriously,
making classes have separate __bases__ and __class__ attributes at least
gives the impression of two hierarchies. And that's enough to make some
minds boggle. But I see what you mean.
Thanks much for the elaborate answer, it will probably take some more time
on my side to let it fully sink in. But even in this short time I've
learned a lot! Feels like I just had a free lunch.