mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Update name
This commit is contained in:
parent
01a0957f06
commit
6d57c827a7
1 changed files with 2 additions and 2 deletions
|
@ -520,11 +520,11 @@ complete list of changes, or look through the CVS logs for all the details.
|
||||||
|
|
||||||
.. % Patch 1551443
|
.. % Patch 1551443
|
||||||
|
|
||||||
* A new data type in the :mod:`collections` module: :class:`named_tuple(typename,
|
* A new data type in the :mod:`collections` module: :class:`namedtuple(typename,
|
||||||
fieldnames)` is a factory function that creates subclasses of the standard tuple
|
fieldnames)` is a factory function that creates subclasses of the standard tuple
|
||||||
whose fields are accessible by name as well as index. For example::
|
whose fields are accessible by name as well as index. For example::
|
||||||
|
|
||||||
>>> var_type = collections.named_tuple('variable',
|
>>> var_type = collections.namedtuple('variable',
|
||||||
... 'id name type size')
|
... 'id name type size')
|
||||||
# Names are separated by spaces or commas.
|
# Names are separated by spaces or commas.
|
||||||
# 'id, name, type, size' would also work.
|
# 'id, name, type, size' would also work.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue