Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: <Paul_Koning@Dell.com>
To: <tromey@redhat.com>
Cc: <gdb-patches@sourceware.org>
Subject: RE: [Python] Allow attribute references to gdb.Value objects
Date: Mon, 15 Aug 2011 20:54:00 -0000	[thread overview]
Message-ID: <09787EF419216C41A903FD14EE5506DD0151D581B5@AUSX7MCPC103.AMER.DELL.COM> (raw)
In-Reply-To: <m3pqk6csop.fsf@fleche.redhat.com>

Sorry about the top posting, that's about all I can do with the unfortunate mail program I have. 

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 machinery 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 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.  I'm going through that right now -- doing a bunch of scripts to help debug a specific 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 releases won't be an issue at all.  But writing more natural-feeling Python code is a more important consideration.

	paul

-----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" ==   <Paul_Koning@Dell.com> writes:

Paul> That's a fair point, but it comes at the expense of making the 
Paul> code look rather un-Pythonic.  It 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


  reply	other threads:[~2011-08-15 20:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-12 19:33 Paul Koning
2011-08-15 19:09 ` Tom Tromey
2011-08-15 20:30   ` Paul_Koning
2011-08-15 20:43     ` Tom Tromey
2011-08-15 20:54       ` Paul_Koning [this message]
2011-08-16  1:12         ` Daniel Jacobowitz
2011-08-16 10:48           ` Paul_Koning

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=09787EF419216C41A903FD14EE5506DD0151D581B5@AUSX7MCPC103.AMER.DELL.COM \
    --to=paul_koning@dell.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox