From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPvaJ-0001fi-9y for qemu-devel@nongnu.org; Thu, 03 May 2012 08:56:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SPva3-0003wR-B5 for qemu-devel@nongnu.org; Thu, 03 May 2012 08:56:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63663) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPva3-0003vF-3O for qemu-devel@nongnu.org; Thu, 03 May 2012 08:56:23 -0400 Message-ID: <4FA2806D.8040907@redhat.com> Date: Thu, 03 May 2012 14:56:13 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <2474f1d2-b6e2-475b-a45e-2fadf28625e5@zmail13.collab.prod.int.phx2.redhat.com> <4FA19277.2030209@us.ibm.com> <4FA1AC32.8020301@redhat.com> <4FA27DDA.10008@us.ibm.com> In-Reply-To: <4FA27DDA.10008@us.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 11/21] qdev: move bus properties to abstract superclasses List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: liwp@linux.vnet.ibm.com, peter maydell , qemu-devel@nongnu.org, afaerber@suse.de 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