From dab9fb3dc2d0a1ccdf4a1a342310af00b6935758 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 16 Dec 2025 12:38:11 +0100 Subject: [PATCH] Clarify that PyStructSequence is different from collections.namedtuple (#142626) --- Doc/c-api/tuple.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Doc/c-api/tuple.rst b/Doc/c-api/tuple.rst index d0add48d7e84..3e3752696c46 100644 --- a/Doc/c-api/tuple.rst +++ b/Doc/c-api/tuple.rst @@ -148,8 +148,11 @@ Tuple Objects Struct Sequence Objects ----------------------- -Struct sequence objects are the C equivalent of :func:`~collections.namedtuple` -objects, i.e. a sequence whose items can also be accessed through attributes. +A struct sequence object is a :term:`named tuple`, that is, a sequence +whose items can also be accessed through attributes. +It is similar to :func:`collections.namedtuple`, but provides a slightly +different interface. + To create a struct sequence, you first have to create a specific struct sequence type. -- 2.47.3