From: Petr Viktorin Date: Tue, 16 Dec 2025 11:38:11 +0000 (+0100) Subject: Clarify that PyStructSequence is different from collections.namedtuple (#142626) X-Git-Tag: v3.15.0a3~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dab9fb3dc2d0a1ccdf4a1a342310af00b6935758;p=thirdparty%2FPython%2Fcpython.git Clarify that PyStructSequence is different from collections.namedtuple (#142626) --- 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.