-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
bpo-21056: Document return type of next method of csv reader #146
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
Conversation
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow these steps to rectify the issue:
Thanks again to your contribution and we look forward to looking at it! |
Doc/library/csv.rst
Outdated
| to the current dialect. Usually you should call this as ``next(reader)``. | ||
| Return the next row of the reader's iterable object as a list (if reader) or | ||
| dict (if DictReader), parsed according to the current dialect. Usually you | ||
| should call this as ``next(reader)``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to change these to:
Return the next row of the reader's iterable object as a list (if the object was returned from
reader()) or a dict (if it is aDictReader) [...]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good! Fixed.
|
Could you please check the bpo number? bpo-29521 has to do with Sphinx and building documentation, and has nothing to do with CSV support. As far as I know. |
Yeah, Thanks! I have fixed it now. |
Doc/library/csv.rst
Outdated
| Return the next row of the reader's iterable object as a list, parsed according | ||
| to the current dialect. Usually you should call this as ``next(reader)``. | ||
| Return the next row of the reader's iterable object as a list (if the object | ||
| was returned from ``reader()``) or a dict (if it is a ``DictReader``), parsed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reader() is not very clear here. "[...] from :func:`reader`" would be much clearer.
Doc/library/csv.rst
Outdated
| Return the next row of the reader's iterable object as a list, parsed according | ||
| to the current dialect. Usually you should call this as ``next(reader)``. | ||
| Return the next row of the reader's iterable object as a list (if the object | ||
| was returned from ``reader()``) or a dict (if it is a ``DictReader``), parsed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it is a :class:`DictReader` instance
Doc/library/csv.rst
Outdated
| to the current dialect. Usually you should call this as ``next(reader)``. | ||
| Return the next row of the reader's iterable object as a list (if the object | ||
| was returned from ``reader()``) or a dict (if it is a ``DictReader``), parsed | ||
| according to the current dialect. Usually you should call this as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add two spaces after a full-stop:
[...] dialect. Usually [...]|
@berkerpeksag Thanks for the Review, I have made the changes now. Please have a look. |
berkerpeksag
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at this again, I agree with Josh Rosenberg's comment at https://bugs.python.org/issue21056#msg214856 It would be better to the documentation for __next__ and document the return types of them in their documentation. Plus, we can adapt the examples you gave in #146 (comment) to the existing ones.
|
This looks fine. I'm not sure it is necessary though (I don't recall it ever having been a source of confusion). |
|
Thanks @aktech |
…ythonGH-146) (cherry picked from commit d618c8c)
…ythonGH-146) (cherry picked from commit d618c8c)
|
Added the sprint label, as this PR was submitted at the PyCon Pune 2017 core development sprint. |
This fix prevent a NULL-pointer access (SEGFAULT), if a thread terminates with a MemoryError exception.
This fix prevent a NULL-pointer access (SEGFAULT), if a thread terminates with a MemoryError exception. (cherry picked from commit bcd724c)
Merge the PR if: - PR has "awaiting merge" and "automerge" labels, and - all CI status checks have passed. It will: - replace `#` with `GH-` - get the commit message from PR title and description Closes python/bedevere#14 Closes python/core-workflow#29
csv.reader
csv.DictReader
Contents of
foo.csvDocumentation: https://docs.python.org/3.7/library/csv.html#reader-objects