Message263733
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.
""" |
|
Date |
User |
Action |
Args |
2016-04-19 12:25:44 | paul.moore | set | recipients:
+ paul.moore, docs@python |
2016-04-19 12:25:44 | paul.moore | set | messageid: <1461068744.46.0.957777609901.issue26805@psf.upfronthosting.co.za> |
2016-04-19 12:25:44 | paul.moore | link | issue26805 messages |
2016-04-19 12:25:44 | paul.moore | create | |
|