mirror of
https://github.com/python/cpython.git
synced 2025-10-02 21:25:24 +00:00
[3.12] Add typing.NamedTuple
in glossary section for named tuples (GH-108327) (#116689)
(cherry picked from commit 149f7f7ae2
)
Co-authored-by: Tushar Sadhwani <tushar.sadhwani000@gmail.com>
This commit is contained in:
parent
817ccac17c
commit
65c6620a3a
1 changed files with 5 additions and 4 deletions
|
@ -840,10 +840,11 @@ Glossary
|
||||||
Some named tuples are built-in types (such as the above examples).
|
Some named tuples are built-in types (such as the above examples).
|
||||||
Alternatively, a named tuple can be created from a regular class
|
Alternatively, a named tuple can be created from a regular class
|
||||||
definition that inherits from :class:`tuple` and that defines named
|
definition that inherits from :class:`tuple` and that defines named
|
||||||
fields. Such a class can be written by hand or it can be created with
|
fields. Such a class can be written by hand, or it can be created by
|
||||||
the factory function :func:`collections.namedtuple`. The latter
|
inheriting :class:`typing.NamedTuple`, or with the factory function
|
||||||
technique also adds some extra methods that may not be found in
|
:func:`collections.namedtuple`. The latter techniques also add some
|
||||||
hand-written or built-in named tuples.
|
extra methods that may not be found in hand-written or built-in named
|
||||||
|
tuples.
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
The place where a variable is stored. Namespaces are implemented as
|
The place where a variable is stored. Namespaces are implemented as
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue