From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20459 invoked by alias); 7 Apr 2009 01:16:36 -0000 Received: (qmail 20448 invoked by uid 22791); 7 Apr 2009 01:16:36 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 07 Apr 2009 01:16:31 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id F2AE010E99; Tue, 7 Apr 2009 01:16:28 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id C976B10E83; Tue, 7 Apr 2009 01:16:28 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1LqzvP-0003hy-GG; Mon, 06 Apr 2009 21:16:27 -0400 Date: Tue, 07 Apr 2009 01:16:00 -0000 From: Daniel Jacobowitz To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: Python pretty-printing [3/6] Message-ID: <20090407011627.GA13882@caradoc.them.org> Mail-Followup-To: Tom Tromey , gdb-patches@sourceware.org References: <20090403163024.GB28512@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-04/txt/msg00120.txt.bz2 On Mon, Apr 06, 2009 at 05:26:06PM -0600, Tom Tromey wrote: > Daniel> So the constructor does a lookup. This will be a little weird if we > Daniel> want to create types from scratch someday (could be very useful). > > At that point we can always make the constructor change its behavior > depending on the runtime type of the argument. > > t = Type(gdb.STRUCT) # make a new struct, STRUCT is an int > t = Type("whatever") # look up "whatever" OK, that makes sense. > Daniel> And what happens if name is not given? > > This is some relic or misconception in the code... the name need not > be optional. Let's fix the docs then. > Daniel> Anyway, I wonder if there shouldn't be an explicit lookup > Daniel> routine instead. > > I like it ok the way it is. But, if you really want it changed, I > will do that; now is not a super time to do this, but it will only be > harder in the future. Thiago, what do you think? Especially if we have to make other incompatible changes now anyway, I'd rather have a lookup routine for this than a constructor. But I don't want to just make work for you. At some point I know we'll want explicit lookup routines; there's scope to consider. -- Daniel Jacobowitz CodeSourcery