My confusion concerns the distinction between class inheritance:
> Given this, a Python programmer could create new metaclasses by subclassing,
> as follows. To borrow Matt's example,
>
> class SMART_CLASS(CLASS):
> [...]
and use of the 'is' qualifier for class definitions:
> There's only one place the syntax would need to be changed and that
> is to indicate that a class is an instance of a particular metaclass.
> Again, to borrow Matt's example:
>
> class SmartRect is SMART_CLASS:
> [...]
My shaky notion is based on the guess that you're talking about
compartmenting two kinds of object methods. "Meta" methods would
implement things like the mechanism for invocing methods, themselves
(invokemethod), or the mechanism by which object attributes are added
(addattribute). I guess such meta-methods would influence behavior of
their objects across operations. "Regular" methods operations would
be the ones that only pertain to specific operations on the object,
like __setitem__/__getitem__ and __add__/__div__, etc.
Am i on the right track here?
And if so (big if), why is it necessary that inheritance of the meta
behaviors is distinguished from inheritance of the "regular"
behaviors? Aside from determining the operations which are to be used
in the actual production of subclass object (eg, the 'addmethod'
method), i don't see why metaclass operations like invokemethod or
addattribute can't just be inherited like other operations. I'm not
saying that i doubt it would be messy, just that the reason - how - it
would be messy is obscure to me.
Thanks for any enlightenment,
Ken
ken.manheimer@nist.gov, 301 975-3539