inline metaclasses

K.S.Sreeram sreeram at tachyontech.net
Tue Jul 4 05:21:56 EDT 2006


Marc 'BlackJack' Rintsch wrote:
> K.S.Sreeram wrote:
>> The very fact that you can put a loop inside __metaclass__ may be reason
>> enough for a one-off metaclass.
> 
> Ah, it's not the loop but the access to the `dict`!  You can write loops
> at class level too but I haven't found a way to access `X`s `__dict__`
> because `X` does not exist at this point.

You're right. I guess i wasn't clear in my previous post, but I was
referring to 'the ability to process the dict (say, using loops)'

> BTW, if that's what gangesmaster is after then it seem to work already. 
> Put ``(object)`` after ``X`` and return something, say 'a' and 'b', in the
> getters and the example prints 'a' and 'b'.

btw, the example seems to work even with old-style classes.

Regards
Sreeram

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20060704/b7ee501d/attachment.sig>


More information about the Python-list mailing list