Skip to content

Commit 9fc319d

Browse files
authored
bpo-42360: Add advice to help avoid pickling issues. (pythonGH-23305)
1 parent 4c24b08 commit 9fc319d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Doc/library/collections.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,9 @@ they add the ability to access fields by name instead of position index.
862862
Named tuple instances do not have per-instance dictionaries, so they are
863863
lightweight and require no more memory than regular tuples.
864864

865+
To support pickling, the named tuple class should be assigned to a variable
866+
that matches *typename*.
867+
865868
.. versionchanged:: 3.1
866869
Added support for *rename*.
867870

0 commit comments

Comments
 (0)