]> granicus.if.org Git - python/commitdiff
20004: Note that the setter in csv.DictReader is broken.
authorR David Murray <rdmurray@bitdance.com>
Tue, 17 Dec 2013 17:09:46 +0000 (12:09 -0500)
committerR David Murray <rdmurray@bitdance.com>
Tue, 17 Dec 2013 17:09:46 +0000 (12:09 -0500)
This is a comment in the code because only someone reading the code would try
setting fieldnames to None in the first place...

Lib/csv.py

index fc080cce1ba09cec6f6d2de78bfa4348517a558a..c155ada794a606f26fb105d8227d100bbd986e1a 100644 (file)
@@ -93,6 +93,10 @@ class DictReader:
         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