From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27956 invoked by alias); 15 Aug 2011 20:54:44 -0000 Received: (qmail 27945 invoked by uid 22791); 15 Aug 2011 20:54:43 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from ausxipps301.us.dell.com (HELO ausxipps301.us.dell.com) (143.166.148.223) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 15 Aug 2011 20:54:29 +0000 X-Loopcount0: from 10.175.216.250 From: To: CC: Date: Mon, 15 Aug 2011 20:54:00 -0000 Subject: RE: [Python] Allow attribute references to gdb.Value objects Message-ID: <09787EF419216C41A903FD14EE5506DD0151D581B5@AUSX7MCPC103.AMER.DELL.COM> References: <3A56CC74-0A48-47E8-BBA2-6E2BEB2FB588@comcast.net> <09787EF419216C41A903FD14EE5506DD0151D58146@AUSX7MCPC103.AMER.DELL.COM> In-Reply-To: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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/msg00316.txt.bz2 Sorry about the top posting, that's about all I can do with the unfortunate= mail program I have.=20 If you want widely used and distributed robust scripts like pretty-printers= , yes, indeed. On the other hand, I also look at the Python scripting mach= inery as general purpose scripting to do the sort of things done by armies = of users -- exactly as the old scripting stuff was used. There you're deal= ing with stuff that may be much more ad-hoc, limited in life, easily tweake= d if it breaks, a user community that might just be one or two people. I'm= going through that right now -- doing a bunch of scripts to help debug a s= pecific problem. That 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 across gdb re= leases won't be an issue at all. But writing more natural-feeling Python c= ode is a more important consideration. paul -----Original Message----- From: Tom Tromey [mailto:tromey@redhat.com]=20 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 writes: Paul> That's a fair point, but it comes at the expense of making the=20 Paul> code look rather un-Pythonic. It seems reasonable to offer the=20 Paul> option, and document the fact that code that takes advantage of it=20 Paul> may be affected by new built-in attributes. My reasoning is that we want to encourage robust pretty-printers (a main us= e 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