Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f5a64498
Commit
f5a64498
authored
Jan 13, 2008
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Named tuple is a concept, not a specific type.
parent
cb549142
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
Doc/glossary.rst
Doc/glossary.rst
+11
-5
No files found.
Doc/glossary.rst
View file @
f5a64498
...
...
@@ -340,11 +340,17 @@ Glossary
also :term:`immutable`.
named tuple
A tuple subclass whose elements also are accessible as attributes via
fixed names (the class name and field names are indicated in the
individual documentation of a named tuple type, like ``TestResults(failed,
attempted)``). Named tuple classes are created by
:func:`collections.namedtuple`.
Any tuple-like class whose indexable fields are also accessible with
named attributes (for example, :func:`time.localtime` returns a
tuple-like object where the *year* is accessable either with an
index such as ``t[0]`` or with a named attribute like ``t.tm_year``).
A named tuple can be a built-in type such as :class:`time.struct_time`,
or it can be created with a regular class definition. A full featured
named tuple can also be created with the factory function
:func:`collections.namedtuple`. The latter approach automatically
provides extra features such as a self-documenting representation like
``Employee(name='jones', title='programmer')``.
namespace
The place where a variable is stored. Namespaces are implemented as
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment