Web page / doc improvement

Hi, I want to submit an improvement, not really a bug but it is smth that may help people that need to deal with large csv files In https://docs.python.org/3/library/csv.html I find in the example the line dialect = csv.Sniffer().sniff(csvfile.read(1024)) while it would be probably better to use smth like: dialect = csv.Sniffer().sniff(csvfile.readline()) because of no magic numbers and cleared rationale behind (I read it as: please try to infer the dialect from the header line of the csv file, which makes a lot of sense) -- Thank you, Best Regards Piergiovanni Bazzana

Thanks for the suggestion. I don't think `readline` is a good suggestion, since the first line is frequently a header. Some headers don't need quoting, so you can't sniff quote characters from them. I see a magic number in an example as an invitation to use something better for my particular use :) On 20. 06. 23 10:42, Piergiovanni Bazzana wrote:

Thanks for the suggestion. I don't think `readline` is a good suggestion, since the first line is frequently a header. Some headers don't need quoting, so you can't sniff quote characters from them. I see a magic number in an example as an invitation to use something better for my particular use :) On 20. 06. 23 10:42, Piergiovanni Bazzana wrote:
participants (2)
-
Petr Viktorin
-
Piergiovanni Bazzana