[issue27497] csv module: Add return value to DictWriter.writeheader

Skip Montanaro report at bugs.python.org
Thu Jul 14 06:01:31 EDT 2016


Skip Montanaro added the comment:

I agree writeheader() should have returned the value of writerow(), but have no opinion on the more esoteric stuff you're discussing. I think you could argue that adding the "return" would be a bug fix.

Personally, I long ago got in the habit of using the writerow(dict(zip(fh, fh))) idiom, didn't catch on at the time that writeheader() was even available in 2.7, and still just use the idiom most of the time. It's a one-liner. The OP could easily use that in contexts where writeheader() doesn't do the right thing.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27497>
_______________________________________


More information about the Python-bugs-list mailing list