[issue29405] improve csv.Sniffer().sniff() behavior

2017-02-05 Thread Xiang Zhang
Xiang Zhang added the comment: I am fine with any version (both are simple and not the hardest part to understand in the logic). :-) I have no opinion on which is better. -- ___ Python tracker

[issue29405] improve csv.Sniffer().sniff() behavior

2017-02-05 Thread Berker Peksag
Berker Peksag added the comment: > [...] but I want to make the change small so others won't get unfamiliar with > the new code. :-) Assuming it doesn't cause any behavior changes, I find Milt's patch simple enough and easier to understand than the version uses 'iteration' variable. -

[issue29405] improve csv.Sniffer().sniff() behavior

2017-02-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6d0a09623155710680ff19f05f279d45c007a304 by Xiang Zhang in branch 'master': Issue #29405: Make total calculation in _guess_delimiter more accurate. https://github.com/python/cpython/commit/6d0a09623155710680ff19f05f279d45c007a304 --

[issue29405] improve csv.Sniffer().sniff() behavior

2017-02-05 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks Milt. I committed with my change not because it's better, but I want to make the change small so others won't get unfamiliar with the new code. :-) -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___

[issue29405] improve csv.Sniffer().sniff() behavior

2017-02-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 724d1aa7589b by Xiang Zhang in branch 'default': Issue #29405: Make total calculation in _guess_delimiter more accurate. https://hg.python.org/cpython/rev/724d1aa7589b -- nosy: +python-dev ___ Python trac

[issue29405] improve csv.Sniffer().sniff() behavior

2017-02-03 Thread Xiang Zhang
Changes by Xiang Zhang : -- stage: patch review -> commit review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29405] improve csv.Sniffer().sniff() behavior

2017-02-03 Thread Milt Epstein
Milt Epstein added the comment: That's right, with 11 lines in the sample data, total will become 20 on the second iteration. And that throws off some of the computations done in that function. Your patch looks good, in that it will achieve what I'm requesting. But :-), your pointing out th

[issue29405] improve csv.Sniffer().sniff() behavior

2017-02-03 Thread Xiang Zhang
Xiang Zhang added the comment: Sounds reasonable. IIUC if the sample data gets 11 lines the total could be 20. I also think the second min is redundant. Would you mind review my patch Milt? -- keywords: +patch stage: -> patch review type: behavior -> enhancement versions: +Python 3.7 -

[issue29405] improve csv.Sniffer().sniff() behavior

2017-02-03 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +xiang.zhang ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue29405] improve csv.Sniffer().sniff() behavior

2017-01-31 Thread Milt Epstein
Milt Epstein added the comment: FWIW, it might be more concise and more consistent with the existing code to change the one line to: total = min(float(chunkLength * iteration), float(len(data))) -- ___ Python tracker

[issue29405] improve csv.Sniffer().sniff() behavior

2017-01-31 Thread Milt Epstein
New submission from Milt Epstein: I'm trying to use csv.Sniffer().sniff(sample_data) to determine the delimiter on a number of input files. Through some trial and error, many "Could not determine delimiter" errors, and analyzing how this routine works/behaves, I settled on sample_data being s