From 609029338e5ff205699879fcb7a75890b2c6d0bf Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Wed, 11 Sep 2019 20:01:51 -0700 Subject: [PATCH] bpo-38096: Complete the "structseq" and "named tuple" cleanup --- Doc/glossary.rst | 2 +- Objects/structseq.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Doc/glossary.rst b/Doc/glossary.rst index 84d0fcab9d75b3..e601e8b3698410 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -757,7 +757,7 @@ Glossary Some named tuples are built-in types (such as the above examples). Alternatively, a named tuple can be created from a regular class definition that inherits from :class:`tuple` and that defines named - fields. Such as class can be written by hand or it can be created with + fields. Such a class can be written by hand or it can be created with the factory function :func:`collections.namedtuple`. The latter technique also adds some extra methods that may not be found in hand-written or built-in named tuples. diff --git a/Objects/structseq.c b/Objects/structseq.c index 2c25e1646a2a67..320bf080d7e3d5 100644 --- a/Objects/structseq.c +++ b/Objects/structseq.c @@ -1,5 +1,11 @@ -/* Implementation helper: a struct that looks like a tuple. See timemodule - and posixmodule for example uses. */ +/* Implementation helper: a struct that looks like a tuple. + See timemodule and posixmodule for example uses. + + The structseq helper is considered an internal CPython implementation + detail. Docs for modules using structseqs should call them + "named tuples" (be sure to include a space between the two + words and add a link back to the term in Docs/glossary.rst). +*/ #include "Python.h" #include "pycore_tupleobject.h"