Greg Ewing wrote:
> Talin wrote:
>> A different approach would be to say that the class decorator can 
>> overload the '__setattr__' method on the class itself during class 
>> creation:
> 
> But it doesn't work that way -- class attributes don't
> go through __setattr__ during class creation. They go
> into a dict that is passed to the type object's
> constructor. The class doesn't even exist while the
> class body is being evaluated.

I see that as a shortcoming of the current metaclass implementation. It 
would be much more useful IMHO if the the metaclass had access to the 
declaration order. Perhaps the class decorator protocol could somehow 
take this into account?

-- Talin
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to