[Types-sig] method binding
Evan Simpson
evan@tokenexchange.com
Tue, 8 Dec 1998 12:03:41 -0600
Some twist! Let me see if I've got all the parts.
1. No object is intrinsically a class. "Classness" is a way of *using* an
object.
2. Objects can delegate attribute fetching to __bases__ objects in almost
the same way current classes do, except that the fetched attribute is not
processed or hooked in any way (eg. you get raw functions instead of
methods).
3. Objects can also delegate attribute fetching to __classes__ objects, or
more specifically, to their __getinstattr__ functions.
4. If all else fails, the object can use its own __getattr__ to produce an
attribute.
Mmf. This really turns things on their heads. JvR's scheme essentially
leaves classes untouched, alters instances slightly, and provides some new
opportunities for hooks and anonymous objects. Existing code works
unchanged. This, on the other hand, would break everything. Not a deadly
objection, if we're thinking Python 2.0, but still significant.
How do you spell something which acts like classes do now? How do you
obtain an 'instance' from this 'class'? How do you choose to treat an
object as a class when handling it directly (not through delegation from an
'instance')?
I'm confused, but interested.
Evan