-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Error in the documentation for csv.reader #113046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The bold text refers to the first argument to |
@pscabot Thanks for submitting the docs issue. As @ericvsmith mentions, the existing documentation accurately reflects the implementation. I recommend taking a look at https://peps.python.org/pep-0305/ as called out in the "see also" box. This should give some additional clarity. I'm going to go ahead and close this issue. Please feel free to ask for additional clarification of the |
I am reopening because the second sentence is a bit confusing and I think it should be replaced, as suggested below. In full, it says
The sentence says that I think the replacement should be properly say what 'csvfile' must be, something like:
|
I agree the documentation could be improved. @pscabot : Does Terry's change above make sense to you? |
@ericvsmith
|
I don't think we should link to Return a reader object which will iterate over lines in the given |
I would still recommend a new line. All other changes are great. |
Thanks @terryjreedy for the additions. ❤️ |
I don't think the sentence is actually ambiguous as "its" couldn't grammatically refer to the "reader object" in the previous sentence. Regardless, maybe this is less wordy and clearer: CHANGE: "csvfile can be any object which supports the iterator protocol and returns a string each time its __next__() method is called"... |
I think it's confusing to mention A slight tweak: Return a reader object which will process lines from the given csvfile. csvfile must be an iterable of strings, each with the needed format. csvfile is most commonly a file-like object or list. Although "with the needed format" seems a little wishy-washy. Maybe "in csv format"? |
I agree that the link is sufficient, and that part of my proposal was a wishy-washy place-holder. How about "each in the reader's defined csv format" or "each in the csv format defined by the other arguments"? My point here is that there is no one concrete 'csv format', but a family of csv formats. |
I like "each in the reader's defined csv format". |
Making a PR now. Thanks for the discussion here. I far prefer hashing out short doc patches on the issue, without bot noise, than on the PR itself. |
Clarify nature of csvfile.
@jeremy-dolan As I said in #113046 (comment), An iterables does not have a |
Clarify nature of csvfile. (cherry picked from commit 84df317) Co-authored-by: Terry Jan Reedy <[email protected]>
Clarify nature of csvfile. (cherry picked from commit 84df317) Co-authored-by: Terry Jan Reedy <[email protected]>
Clarify nature of csvfile. (cherry picked from commit 84df317) Co-authored-by: Terry Jan Reedy <[email protected]>
Clarify nature of csvfile. (cherry picked from commit 84df317) Co-authored-by: Terry Jan Reedy <[email protected]>
Clarify nature of csvfile.
Clarify nature of csvfile.
Uh oh!
There was an error while loading. Please reload this page.
Documentation
In the description for csv.reader function it says:
Return a reader object which will iterate over lines in the given csvfile. csvfile can be any object which supports the iterator protocol and returns a string each time its
__next__()
method is called(The bold emphasis is mine)
However it returns a
list
as it's properly documented atcsvreader.__next()__
Linked PRs
The text was updated successfully, but these errors were encountered: