Il 03/05/2012 14:45, Anthony Liguori ha scritto: > On 05/02/2012 04:50 PM, Paolo Bonzini wrote: >> Il 02/05/2012 22:00, Anthony Liguori ha scritto: >> >>> Classes are first class objects and can contain members, but I don't >>> know of any system where you actively look at the same field in a >>> super class for each class in the hierarchy. That's really trippy. >> >> Just because it's new to you. Smalltalk has been doing that for 30-odd >> years. > > Ok, I've played around quite a bit with Python now and you are right. > But I still don't like what you're proposing. I have two main reasons: > > 1) I think it's too clever. I understand you disagree and this wouldn't > be a sticking point for me but nonetheless, I want to register that > compliant :-)
Fair. :) > 2) If you do introspection in this method, it means that *all* > properties have to be registered as static properties to be > introspected. That's a blocker for me. We're always going to need to > do the object_new() + enumerate + object_delete() trick in order to > introspect non-static properties. Enumeration without some assistance from the class is impossible anyway if you go with lazily-created properties for "big" arrays (such as those you find in interrupt controllers). Paolo