mirror of
https://github.com/python/cpython.git
synced 2025-09-23 17:03:23 +00:00
Mention types.SimpleNamespace in collections.namedtuple doc
Issue #26805.
This commit is contained in:
parent
119ebb70e9
commit
b5d164cc3f
1 changed files with 5 additions and 0 deletions
|
@ -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
|
Named tuple instances do not have per-instance dictionaries, so they are
|
||||||
lightweight and require no more memory than regular tuples.
|
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
|
.. versionchanged:: 3.1
|
||||||
Added support for *rename*.
|
Added support for *rename*.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue