From b990202f3ad1634e43dbba88ef44da7db32cf640 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sun, 15 Nov 2020 13:24:10 -0800 Subject: [PATCH] bpo-42360: Add advice to help avoid pickling issues. --- Doc/library/collections.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index f538da5e1c9faa..1293f542b04377 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -862,6 +862,9 @@ they add the ability to access fields by name instead of position index. Named tuple instances do not have per-instance dictionaries, so they are lightweight and require no more memory than regular tuples. + To support pickling, the named tuple class should be assigned to a variable + that matches *typename*. + .. versionchanged:: 3.1 Added support for *rename*.