From: Paul Moore Date: Tue, 19 Apr 2016 18:17:16 +0000 (+0100) Subject: Mention types.SimpleNamespace in collections.namedtuple doc X-Git-Tag: v3.6.0a1~166 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9a8d0d5c7d1ad3bfee57efce7860cded9790eee7;p=python Mention types.SimpleNamespace in collections.namedtuple doc Issue #26805. --- diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 728cd485a1..37d9e003cb 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*.