From 78f27e001b5099fee2139afedb2f0992c7022be8 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Wed, 14 Nov 2007 22:56:16 +0000 Subject: Make __fields__ read-only. Suggested by Issac Morland --- Lib/collections.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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): -- cgit v0.12