[Python-Dev] Classes and Metaclasses in Smalltalk
Gordon McMillan
gmcm@hypernet.com
Wed, 2 May 2001 12:01:20 -0400
Hmmm.
Some time ago, Tim asked the question: "Why do you wnat
this stuff?". As far as I can recall, he got 2 answers: "So I
don't have to 'initialize(Klass)'" and "me, too". I don't think
those qualify as answers.
Some time ago (cf, types-sig brouhaha of a couple years ago)
I concluded that the only purpose for this stuff was __getattr__
and __setattr__ hacks. I reached this conclusion by going
nutzo using (Guido's) metaclass hook, and studying the
available uses of ExtensionClass (I could find no public usage
of Don's elegant madness).
I rather liked Guido's "Turtles all the way down" (but his
description was so cryptic that my interpretation may have
been a hallucination), and I suspect he's still headed that way.
Nonetheless, I would like to see this discussion of the
elegance of SmallTalk's incompatible model (and how to fudge
it in Python) balanced by some discussion of the expected
pragmatic benefits. (That's a different topic from subclassing
types.)
start-with-"if-God-wanted-metaclasses-he-wouldn't-have-
invented-proxies"-<wink>-ly y'rs
- Gordon