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 skip.montanaro
Recipients andrei.avk, ejacq, rhettinger, skip.montanaro
Date 2021-06-29.11:50:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1624967413.57.0.622260928168.issue43625@roundup.psfhosted.org>
In-reply-to
Content
Thanks @andrei.avk. You are right, only the complex test is required.

I suppose it's okay to commit this, but reviewing the full code of the has_header method leaves me thinking this is just putting lipstick on a pig. If I read the code correctly, there are two (undocumented) tacit assumptions:

1. The non-header values are numeric.

2. If not numeric, they are fixed length strings whose length generally differs from the length of the putative header.

The second criterion means this has a header:

ab,de
ghi,jkl
ghi,jkl

but this doesn't:

abc,def
ghi,jkl
ghi,jkl

It seems to me that it would be a good idea to at least expand on the documentation of that method and maybe add at least one test case where the CSV sample doesn't have a header. I'll try to get that done and attach a patch.
History
Date User Action Args
2021-06-29 11:50:13skip.montanarosetrecipients: + skip.montanaro, rhettinger, andrei.avk, ejacq
2021-06-29 11:50:13skip.montanarosetmessageid: <1624967413.57.0.622260928168.issue43625@roundup.psfhosted.org>
2021-06-29 11:50:13skip.montanarolinkissue43625 messages
2021-06-29 11:50:13skip.montanarocreate