summaryrefslogtreecommitdiffstats
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)
commitb5d164cc3fc9ba3afbf42b7df58475678b9c772c (patch)
tree507feca879e18be08c4ff5b03d1cd3fd335992da
parent119ebb70e9b7ae15896ced52321d626b757e7cbb (diff)
downloadcpython-b5d164cc3fc9ba3afbf42b7df58475678b9c772c.zip
cpython-b5d164cc3fc9ba3afbf42b7df58475678b9c772c.tar.gz
cpython-b5d164cc3fc9ba3afbf42b7df58475678b9c772c.tar.bz2
Mention types.SimpleNamespace in collections.namedtuple doc
Issue #26805.
-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 858a566..6e165ab 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*.