[Python-checkins] cpython (2.7): 20004: Note that the setter in csv.DictReader is broken.
r.david.murray
python-checkins at python.org
Tue Dec 17 18:09:58 CET 2013
http://hg.python.org/cpython/rev/75c0b65591fd
changeset: 88028:75c0b65591fd
branch: 2.7
user: R David Murray <rdmurray at bitdance.com>
date: Tue Dec 17 12:09:46 2013 -0500
summary:
20004: Note that the setter in csv.DictReader is broken.
This is a comment in the code because only someone reading the code would try
setting fieldnames to None in the first place...
files:
Lib/csv.py | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/Lib/csv.py b/Lib/csv.py
--- a/Lib/csv.py
+++ b/Lib/csv.py
@@ -93,6 +93,10 @@
self.line_num = self.reader.line_num
return self._fieldnames
+ # Issue 20004: Because DictReader is a classic class, this setter is
+ # ignored. At this point in 2.7's lifecycle, it is too late to change the
+ # base class for fear of breaking working code. If you want to change
+ # fieldnames without overwriting the getter, set _fieldnames directly.
@fieldnames.setter
def fieldnames(self, value):
self._fieldnames = value
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list