diff options
author | Raymond Hettinger <python@rcn.com> | 2007-11-14 22:56:16 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2007-11-14 22:56:16 (GMT) |
commit | 78f27e001b5099fee2139afedb2f0992c7022be8 (patch) | |
tree | 49d8a2d7ef4a2acec22891b5bdf9befb63a911ff | |
parent | b5b6f3c46e1dec2b0a3c8e76e33149f2ea8f484c (diff) | |
download | cpython-78f27e001b5099fee2139afedb2f0992c7022be8.zip cpython-78f27e001b5099fee2139afedb2f0992c7022be8.tar.gz cpython-78f27e001b5099fee2139afedb2f0992c7022be8.tar.bz2 |
Make __fields__ read-only. Suggested by Issac Morland
-rw-r--r-- | Lib/collections.py | 2 |
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): |