diff options
author | Andrew Burgess <aburgess@redhat.com> | 2025-04-23 10:22:32 +0100 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2025-04-24 00:13:23 +0100 |
commit | 90fa7d2fd5a26bd0eb933c5cd9297c0e0801dacb (patch) | |
tree | 73d3eebe09ba0e424945e09f19029e5bf6ab4e10 /libctf/ctf-hash.c | |
parent | 2eead96aeba1ec15d258b0952b37cb5d8bfc4c4a (diff) | |
download | binutils-90fa7d2fd5a26bd0eb933c5cd9297c0e0801dacb.zip binutils-90fa7d2fd5a26bd0eb933c5cd9297c0e0801dacb.tar.gz binutils-90fa7d2fd5a26bd0eb933c5cd9297c0e0801dacb.tar.bz2 |
gdb/python: keyword arguments for gdb.Color.escape_sequence
GDB's Python documentation does make it clear that keywords arguments
are supported for functions that take 2 or more arguments. The
documentation makes no promise for keyword argument support on
functions that only take a single argument.
That said, I'm a fan of keyword arguments, I think they help document
the code, and make intentions clearer, even for single argument
functions.
As I'm changing gdb.Color anyway (see previous commit), I'd like to
add keyword argument support to gdb.Color.escape_sequence, even though
this is a single argument method. This should be harmless for anyone
who doesn't want to use keywords, but adds the option for those of us
that do.
I've also removed a redundant check that the 'self' argument was a
gdb.Color object; Python already ensures this is the case.
And I have folded the check that the single argument is a bool into
the gdb_PyArg_ParseTupleAndKeywords call, this means that the error
message will include the incorrect type name now, which should make
debugging issues easier.
Tests have been extended to cover both cases -- it appears the
incorrect argument type error was not previously tested, so it is
now.
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'libctf/ctf-hash.c')
0 files changed, 0 insertions, 0 deletions