summaryrefslogtreecommitdiff
path: root/Lib/collections.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2007-11-14 22:56:16 +0000
committerRaymond Hettinger <python@rcn.com>2007-11-14 22:56:16 +0000
commit6f4f1717ee303ec2b8a79d032a824546dea71ef0 (patch)
treec2a2a5bb29d13a208c787071fe2cc3f88930f4be /Lib/collections.py
parent5d0e41b8488d4d36827b0aaa8564d5f8d3cd2cb8 (diff)
downloadcpython-6f4f1717ee303ec2b8a79d032a824546dea71ef0.tar.gz
Make __fields__ read-only. Suggested by Issac Morland
Diffstat (limited to 'Lib/collections.py')
-rw-r--r--Lib/collections.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/collections.py b/Lib/collections.py
index e0782d03ef..40f5187bce 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):