From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23536 invoked by alias); 16 Aug 2011 01:12:26 -0000 Received: (qmail 23522 invoked by uid 22791); 16 Aug 2011 01:12:24 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-ey0-f169.google.com (HELO mail-ey0-f169.google.com) (209.85.215.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 16 Aug 2011 01:12:09 +0000 Received: by eye22 with SMTP id 22so3500489eye.0 for ; Mon, 15 Aug 2011 18:12:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.14.151.15 with SMTP id a15mr769672eek.88.1313457128575; Mon, 15 Aug 2011 18:12:08 -0700 (PDT) Received: by 10.14.53.11 with HTTP; Mon, 15 Aug 2011 18:12:08 -0700 (PDT) In-Reply-To: <09787EF419216C41A903FD14EE5506DD0151D581B5@AUSX7MCPC103.AMER.DELL.COM> References: <3A56CC74-0A48-47E8-BBA2-6E2BEB2FB588@comcast.net> <09787EF419216C41A903FD14EE5506DD0151D58146@AUSX7MCPC103.AMER.DELL.COM> <09787EF419216C41A903FD14EE5506DD0151D581B5@AUSX7MCPC103.AMER.DELL.COM> Date: Tue, 16 Aug 2011 01:12:00 -0000 Message-ID: Subject: Re: [Python] Allow attribute references to gdb.Value objects From: Daniel Jacobowitz To: Paul_Koning@dell.com Cc: tromey@redhat.com, gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 2011-08/txt/msg00317.txt.bz2 On Mon, Aug 15, 2011 at 4:54 PM, wrote: > Sorry about the top posting, that's about all I can do with the unfortuna= te mail program I have. > > If you want widely used and distributed robust scripts like pretty-printe= rs, yes, indeed. =A0On the other hand, I also look at the Python scripting = machinery as general purpose scripting to do the sort of things done by arm= ies of users -- exactly as the old scripting stuff was used. =A0There you'r= e dealing with stuff that may be much more ad-hoc, limited in life, easily = tweaked if it breaks, a user community that might just be one or two people= . =A0I'm going through that right now -- doing a bunch of scripts to help d= ebug a specific problem. =A0That code may in fact not even be used again at= all after the bug is found, or if it does get used, keeping it working acr= oss gdb releases won't be an issue at all. =A0But writing more natural-feel= ing Python code is a more important consideration. IMO, the robustness choice outweighs this consideration. While a lot of these scripts are for a single-purpose session, I'm finding that we check them in somewhere and adapt them to future bugs. I'm sure they'll break in all sorts of interesting ways; I'd rather not add one that we *know* will end in breakage. > > =A0 =A0 =A0 =A0paul > > -----Original Message----- > From: Tom Tromey [mailto:tromey@redhat.com] > Sent: Monday, August 15, 2011 4:43 PM > To: Koning, Paul > Cc: gdb-patches@sourceware.org > Subject: Re: [Python] Allow attribute references to gdb.Value objects > >>>>>> "Paul" =3D=3D =A0 writes: > > Paul> That's a fair point, but it comes at the expense of making the > Paul> code look rather un-Pythonic. =A0It seems reasonable to offer the > Paul> option, and document the fact that code that takes advantage of it > Paul> may be affected by new built-in attributes. > > My reasoning is that we want to encourage robust pretty-printers (a main = use of the value API), and robust code has to use the dictionary syntax. > So, why not just enforce this by only having the dictionary syntax? > > Tom > --=20 Thanks, Daniel