Message396714
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. |
|
Date |
User |
Action |
Args |
2021-06-29 11:50:13 | skip.montanaro | set | recipients:
+ skip.montanaro, rhettinger, andrei.avk, ejacq |
2021-06-29 11:50:13 | skip.montanaro | set | messageid: <1624967413.57.0.622260928168.issue43625@roundup.psfhosted.org> |
2021-06-29 11:50:13 | skip.montanaro | link | issue43625 messages |
2021-06-29 11:50:13 | skip.montanaro | create | |
|