Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Minor doc fix for Python Type.fields
@ 2025-11-05 18:10 Tom Tromey
  2025-11-05 18:29 ` Paul Koning
  2025-11-05 19:30 ` Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: Tom Tromey @ 2025-11-05 18:10 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes the Python Type.fields documentation in a few minor ways:

* Documents that a new sequence is always returned I've intentionally
  not mentioned that it is currently a list, in case we want to change
  to a tuple someday.

* Move the C++ base class note to the bullet about structure types,
  where it makes more sense.

* Added a blank line before the table to make the info page easier to
  read.
---
 gdb/doc/python.texi | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index 13ffde253d3..44a94aa34c9 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -1501,19 +1501,20 @@ The following methods are provided:
 
 @defun Type.fields ()
 
-Return the fields of this type.  The behavior depends on the type code:
+Return a new sequence of the fields of this type.  The behavior
+depends on the type code:
 
 @itemize @bullet
 
 @item
-For structure and union types, this method returns the fields.
+For structure and union types, this method returns the fields.  The
+base types of C@t{++} classes are also represented as fields.
 
 @item
 Enum types have one field per enum constant.
 
 @item
-Function and method types have one field per parameter.  The base types of
-C@t{++} classes are also represented as fields.
+Function and method types have one field per parameter.
 
 @item
 Array types have one field representing the array's range.
@@ -1525,6 +1526,7 @@ is raised.
 @end itemize
 
 Each field is a @code{gdb.Field} object, with some pre-defined attributes:
+
 @table @code
 @item bitpos
 This attribute is not available for @code{enum} or @code{static}

base-commit: ce106639c2019494833b5a8388d205ba96e7b217
-- 
2.51.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-11-05 19:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-05 18:10 [PATCH] Minor doc fix for Python Type.fields Tom Tromey
2025-11-05 18:29 ` Paul Koning
2025-11-05 19:05   ` Tom Tromey
2025-11-05 19:21     ` Paul Koning
2025-11-05 19:27       ` Tom Tromey
2025-11-05 19:30         ` Paul Koning
2025-11-05 19:30 ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox