summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2007-11-14 22:56:16 (GMT)
committerRaymond Hettinger <python@rcn.com>2007-11-14 22:56:16 (GMT)
commit78f27e001b5099fee2139afedb2f0992c7022be8 (patch)
tree49d8a2d7ef4a2acec22891b5bdf9befb63a911ff /Lib
parentb5b6f3c46e1dec2b0a3c8e76e33149f2ea8f484c (diff)
downloadcpython-78f27e001b5099fee2139afedb2f0992c7022be8.zip
cpython-78f27e001b5099fee2139afedb2f0992c7022be8.tar.gz
cpython-78f27e001b5099fee2139afedb2f0992c7022be8.tar.bz2
Make __fields__ read-only. Suggested by Issac Morland
Diffstat (limited to 'Lib')
-rw-r--r--Lib/collections.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/collections.py b/Lib/collections.py
index e0782d0..40f5187 100644
--- a/Lib/collections.py
+++ b/Lib/collections.py
@@ -54,7 +54,7 @@ def namedtuple(typename, field_names, verbose=False):
template = '''class %(typename)s(tuple):
'%(typename)s(%(argtxt)s)'
__slots__ = ()
- __fields__ = %(field_names)r
+ __fields__ = property(lambda self: %(field_names)r)
def __new__(cls, %(argtxt)s):
return tuple.__new__(cls, (%(argtxt)s))
def __repr__(self):