Ian Bicking: the old part of his blog


FYI, check out the peak.binding.once.Activator metaclass for an example of something that does what you're trying to do here.

Specifically, it tries to adapt all its new attributes to IActiveDescriptor. If they adapt, it calls the descriptor's 'activateInClass(klass,name)' method, and stores the result in the class dictionary in place of the original descriptor. This happens after the class is created, but before it's returned from __new__.

This approach has worked well for PEAK for over a year now, so if you're trying to get or set a de facto standard, maybe you should follow that one. ;)
Comment on Descriptor Nit
by Phillip J. Eby