From 59c7ab2218558b6f69adb409d01eb96f591dbcd2 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Fri, 12 Dec 2025 12:26:49 +0100 Subject: [PATCH] Clarify PyStructSequence is different from collections.namedtuple --- 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 d0add48d7e8457..3e3752696c46d8 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.