summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorPaul Moore <p.f.moore@gmail.com>2016-04-19 18:17:16 (GMT)
committerPaul Moore <p.f.moore@gmail.com>2016-04-19 18:17:16 (GMT)
commit9a8d0d5c7d1ad3bfee57efce7860cded9790eee7 (patch)
treefcf3ce4d8907a063db6ca699763193942c670190 /Doc
parentedaf8653c682fef24cd80fc293091848f736dd90 (diff)
downloadcpython-9a8d0d5c7d1ad3bfee57efce7860cded9790eee7.zip
cpython-9a8d0d5c7d1ad3bfee57efce7860cded9790eee7.tar.gz
cpython-9a8d0d5c7d1ad3bfee57efce7860cded9790eee7.tar.bz2
Mention types.SimpleNamespace in collections.namedtuple doc
Issue #26805.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/collections.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
index 728cd48..37d9e00 100644
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -792,6 +792,11 @@ 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.
+ For simple uses, where the only requirement is to be able to refer to a set
+ of values by name using attribute-style access, the
+ :class:`types.SimpleNamespace` type can be a suitable alternative to using
+ a namedtuple.
+
.. versionchanged:: 3.1
Added support for *rename*.