[Python-checkins] r59501 - python/trunk/Doc/whatsnew/2.6.rst
raymond.hettinger
python-checkins at python.org
Fri Dec 14 19:12:21 CET 2007
Author: raymond.hettinger
Date: Fri Dec 14 19:12:21 2007
New Revision: 59501
Modified:
python/trunk/Doc/whatsnew/2.6.rst
Log:
Update method names for named tuples.
Modified: python/trunk/Doc/whatsnew/2.6.rst
==============================================================================
--- python/trunk/Doc/whatsnew/2.6.rst (original)
+++ python/trunk/Doc/whatsnew/2.6.rst Fri Dec 14 19:12:21 2007
@@ -528,7 +528,7 @@
... '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 @@
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)
More information about the Python-checkins
mailing list