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
366523c6
Commit
366523c6
authored
Dec 14, 2007
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update method names for named tuples.
parent
48eca67a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Doc/whatsnew/2.6.rst
Doc/whatsnew/2.6.rst
+3
-3
No files found.
Doc/whatsnew/2.6.rst
View file @
366523c6
...
...
@@ -528,7 +528,7 @@ complete list of changes, or look through the CVS logs for all the details.
... 'id name type size')
# Names are separated by spaces or commas.
# 'id, name, type, size' would also work.
>>> var_type._
_fields__
>>> var_type._
fields
('id', 'name', 'type', 'size')
>>> var = var_type(1, 'frequency', 'int', 4)
...
...
@@ -536,9 +536,9 @@ complete list of changes, or look through the CVS logs for all the details.
1 1
>>> print var[2], var.type # Equivalent
int int
>>> var._
_asdict__
()
>>> var._
asdict
()
{'size': 4, 'type': 'int', 'id': 1, 'name': 'frequency'}
>>> v2 = var._
_replace__
('name', 'amplitude')
>>> v2 = var._
replace
('name', 'amplitude')
>>> v2
variable(id=1, name='amplitude', type='int', size=4)
...
...
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