-
-
Notifications
You must be signed in to change notification settings - Fork 32k
docs: clarify DictReader's treatment of the first data row. #118549
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
Doc/library/csv.rst
Outdated
@@ -156,8 +156,10 @@ The :mod:`csv` module defines the following classes: | |||
|
|||
The *fieldnames* parameter is a :term:`sequence`. If *fieldnames* is | |||
omitted, the values in the first row of file *f* will be used as the | |||
fieldnames. Regardless of how the fieldnames are determined, the | |||
dictionary preserves their original ordering. | |||
fieldnames and the first row will not produce a dict in the result. If |
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.
Since the first row will be used as the fieldnames and be omitted, how about writing this line as simply:
"...fieldnames and therefore be omitted. If..."
Thanks @nedbat for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
…nGH-118549) (cherry picked from commit 9d67b72) Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
GH-118555 is a backport of this pull request to the 3.12 branch. |
…GH-118549) (#118555) (cherry picked from commit 9d67b72) Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
A clarification based on a discussion in the Python discord.
📚 Documentation preview 📚: https://cpython-previews--118549.org.readthedocs.build/