gh-80678: Add comment on preferred csv delimiters#96199
Conversation
| reflecting the parameters found. If the optional *delimiters* parameter | ||
| is given, it is interpreted as a string containing possible valid | ||
| delimiter characters. | ||
| If not excluded by the *delimiters* parameter, and if there is ambiguity, |
There was a problem hiding this comment.
Why is the documentation here not added to the def sniff docstring? That would be a natural place for documentation that is available from the command line or IDE.
There was a problem hiding this comment.
I'm not sure what information should go into the docstring vs in the docs. I imagine there's some duplicate, but surely not everything in the docs goes into the docstring and vice-versa. The docstring of sniff is looking a bit empty though, so it could use some work for sure.
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
|
The following commit authors need to sign the Contributor License Agreement: |
|
This PR is stale because it has been open for 30 days with no activity. |
| is given, it is interpreted as a string containing possible valid | ||
| delimiter characters. | ||
| If not excluded by the *delimiters* parameter, and if there is ambiguity, | ||
| then delimiter choice will be biased towards ``[',', '\t', ';', ' ', ':']``. |
There was a problem hiding this comment.
This is a little inaccurate, it is in that specific order. Maybe something like ",, ... : in that order"
https://docs.python.org/dev/library/csv.html#csv.Sniffer.sniff
See
cpython/Lib/csv.py
Line 177 in 1499d73
cpython/Lib/csv.py
Lines 369 to 375 in 1499d73