Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Andrew Burgess <aburgess@redhat.com>
Cc: Tom Tromey <tom@tromey.com>,  gdb-patches@sourceware.org
Subject: Re: [PATCH] Use Python safety API in py-symbol.c
Date: Mon, 10 Aug 2026 18:16:11 -0600	[thread overview]
Message-ID: <871pc58qb8.fsf@tromey.com> (raw)
In-Reply-To: <87cxvqkk2n.fsf@redhat.com> (Andrew Burgess's message of "Mon, 10 Aug 2026 17:37:52 +0100")

>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:

>> +/* Normally gdb requires that if a method accepts multiple arguments,
>> +   then it should also accept keywords.  However, there are some
>> +   exceptions to this rule.  These exceptions should use this wrapper.
>> +   This should be used sparingly.
>> +
>> +   A typical exception is something that takes an optional argument.
>> +   So, it may call PyArg_ParseTuple with "|s" or the like.

Andrew> Would it not be better to just update the function in question to accept
Andrew> keyword arguments?  I know some people dislike using them on single
Andrew> argument functions, but surely from the GDB side, supporting them is
Andrew> pretty cheap, then it's up to the user if they want to use them or not?

I didn't do it in this patch because it is (or eventually would be) a
policy change.

FWIW an additional drawback is that means that the argument name is also
now part of the API.

Anyway I don't mind doing it.  The drawbacks seem reasonably minor.

FWIW I count 32 such functions existing now, which is more than I
thought existed.  So I guess another option would be to just drop the
"sparingly" text.

Tom

      reply	other threads:[~2026-08-11  0:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-09 18:23 Tom Tromey
2026-08-10 16:37 ` Andrew Burgess
2026-08-11  0:16   ` Tom Tromey [this message]

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=871pc58qb8.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /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