Clarify that PyStructSequence is different from collections.namedtuple (#142626)

This commit is contained in:
Petr Viktorin 2025-12-16 12:38:11 +01:00 committed by GitHub
parent ba587ed8f3
commit dab9fb3dc2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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.