[Types-sig] Re: Meta-classes discussion starter

Just van Rossum just@letterror.com
Thu, 3 Dec 1998 02:57:42 +0100


>> The last line can't work because
>> - MyClass is in instance of MyMetaClass
>> - MyClass.__init__ will be found in MyMetaClass *before* it can trigger any
>> __getattr__ that could look it up inside MyClass.

M.-A. Lemburg wrote:
>That's why meta objects should have a hook that controlls *all*
>getattr-actions, e.g. __meta_getattr__.

Yeah, they _should_, but I'm talking about this from the perspective of
trying to implement such a thing using Python _today_. I get a long way by
defining an alternative __dict__ and the usual __{get|set|del}attr__ cruft,
but this was a (veryveryvery*very* minor) point where today's Python
implementation let me down...


Just