[Python-Dev] Classes and Metaclasses in Smalltalk (original) (raw)

Greg Ward gward@python.net
Wed, 2 May 2001 08:57:41 -0400


On 02 May 2001, Guido van Rossum said:

Yes, I can see how to write super() using current tools (or 1.5.2 even). The problem is that this makes super calls even more wordy than they already are! I can't think of anything that wouldn't require compiler support though.

I was just doing some gedanken with various ways to spell "super", and I think my favourite is the same as Java's (as I remember it):

class MyClass (BaseClass): def foo (self, arg1, arg2): super.foo(arg1, arg2)

Since I don't know much about Python's guts, I can't say how implementable this is, but I like the spelling. The semantics would be something like this (with adjustments to the reality of Python's guts):

The ability to peek at the calling stack frame is essential to this scheme, in order to fetch the "current object" (self) without needing to have it explicitly passed. Is this as bothersome from C as it is from Python?

    Greg

-- Greg Ward - nerd gward@python.net http://starship.python.net/~gward/ In space, no one can hear you fart.