[New-bugs-announce] [issue26805] Refer to types.SimpleNamespace in namedtuple documentation

Paul Moore report at bugs.python.org
Tue Apr 19 08:25:44 EDT 2016

New submission from Paul Moore:

People often look towards collections.namedtuple when all they actually want is "named attribute" access to a collection of values, without needing a tuple subclass, or positional access. In these cases, types.SimpleNamespace may be a better fit.

I suggest adding the following pointer to the top of the namedtuple documentation:

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 :ref:`types.SimpleNamespace` type may be a suitable alternative to using a namedtuple.

assignee: docs at python
components: Documentation
messages: 263733
nosy: docs at python, paul.moore
priority: normal
severity: normal
status: open
title: Refer to types.SimpleNamespace in namedtuple documentation
type: enhancement
versions: Python 3.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list