Rob Renaud <rren...@google.com> added the comment: I want to make sure I understand. Am I correct in believing that Skip thinks writing headers should be optional, while Jervis believes we should leave the burden to the NamedTupleWriter client?
I agree that we should not unconditionally write headers, but I think that we should write headers by default, much like we read them by default. I believe the implicit header writing is very elegant, and the only reason that the DictWriter object doesn't write headers is the impedance mismatch between dicts and CSV. namedtuples has the field order information, the impedance mismatch is gone, we should no longer be hindered. Implicitly reading but not explicitly writing headers just seems wrong. It also seems wrong to require the construction of "header" namedtuple objects. It's much less natural than dicts holding identity mappings. >>> Point._make(Point._fields) Point(x='x', y='y') To me, that just looks weird and non-obvious to me. That Point instance doesn't really fit in my mind as something that should be a Point. _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue1818> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com