changeset: 101058:f7c9030eff54 branch: 3.5 tag: tip parent: 101048:730a95c2d38f user: Victor Stinner date: Tue Apr 19 15:40:04 2016 +0200 files: Doc/library/collections.rst description: Mention types.SimpleNamespace in collections.namedtuple doc Issue #26805. Patch written by Paul Moore. diff -r 730a95c2d38f -r f7c9030eff54 Doc/library/collections.rst --- a/Doc/library/collections.rst Mon Apr 18 10:28:42 2016 +0200 +++ b/Doc/library/collections.rst Tue Apr 19 15:40:04 2016 +0200 @@ -792,6 +792,11 @@ they add the ability to access fields by 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*.