Message17784
Logged In: YES
user_id=6656
> Metaclasses are not guilty here!
It's more complicated than that.
iter(o) does (roughly)
o->ob_type->tp_iter(o)
At class definition time, if the class defines __iter__, a
wrapper for it is stuffed into the type's tp_iter slot. If
it doesn't, NULL is placed there instead.
What *could* be done is, if the *meta*class defines
__getattr__ or __getattribute__, all the tp_ slots could be
filled with a special wrapper that calls the generic
attribute getter. But that would be quite a coding effort,
and these classes would have pretty atrocious performance.
And making this work when you assign to __getattribute__ on
the metaclass would be a truly crazy piece of code.
Or the docs could note this limitation. |
|
Date |
User |
Action |
Args |
2007-08-23 14:16:07 | admin | link | issue789262 messages |
2007-08-23 14:16:07 | admin | create | |
|