diff options
author | Andrew Burgess <aburgess@redhat.com> | 2025-04-22 18:01:07 +0100 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2025-04-23 15:46:22 +0100 |
commit | bd7a2f22b11e37ce35c3a78f6fb54ef74270b903 (patch) | |
tree | 648bf05447ae30e8e12a7dfeb071499f46a64188 /gdb/doc/python.texi | |
parent | dff7f6c72d05d8a378dc346e6900ba7c4eba759f (diff) | |
download | binutils-bd7a2f22b11e37ce35c3a78f6fb54ef74270b903.zip binutils-bd7a2f22b11e37ce35c3a78f6fb54ef74270b903.tar.gz binutils-bd7a2f22b11e37ce35c3a78f6fb54ef74270b903.tar.bz2 |
gdb/python: remove Py_TPFLAGS_BASETYPE from gdb.Color
Remove the Py_TPFLAGS_BASETYPE flag from the gdb.Color type. This
effectively makes gdb.Color final; users can no longer create classes
that inherit from gdb.Color.
Right now I cannot think of any cases where inheritance would be
needed over composition for a simple type like gdb.Color. If I'm
wrong, then it's easy to add Py_TPFLAGS_BASETYPE back in later, this
would be an extension of the API. But it's much harder to remove the
flag later as that might break existing user code (note: there has
been no release of GDB yet that includes the gdb.Color type).
Introducing this restriction makes the next commit easier.
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/doc/python.texi')
-rw-r--r-- | gdb/doc/python.texi | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi index 80f4c14..45f5f70 100644 --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi @@ -7136,6 +7136,8 @@ Direct 24-bit RGB colors. @end table +It is not possible to sub-class the @code{Color} class. + @node Architectures In Python @subsubsection Python representation of architectures @cindex Python architectures |