This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients mishok13, ncoghlan, rhettinger, skip.montanaro
Date 2008-07-27.04:15:47
SpamBayes Score 0.060850557
Marked as misclassified No
Message-id <1217132148.42.0.233271510487.issue3436@psf.upfronthosting.co.za>
In-reply-to
Content
Like Raymond, I have issues with the idea of implicitly reading the
headers in __init__, but would be fine with the idea of a separate
method in 2.7/3.1.

As far as working around the absence of such a method goes, I personally
use itertools.chain if I happen to need the headers before I start
iterating:

r = csv.DictReader(open('test.csv'))
first = next(r)
# Do something with r.fieldnames
for row in chain(first, r):
    # Do something with each row
History
Date User Action Args
2008-07-27 04:15:48ncoghlansetrecipients: + ncoghlan, skip.montanaro, rhettinger, mishok13
2008-07-27 04:15:48ncoghlansetmessageid: <1217132148.42.0.233271510487.issue3436@psf.upfronthosting.co.za>
2008-07-27 04:15:47ncoghlanlinkissue3436 messages
2008-07-27 04:15:47ncoghlancreate