summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-05-03 15:55:09 (GMT)
committerGitHub <noreply@github.com>2024-05-03 15:55:09 (GMT)
commit4a18a9b4b3cd7d8ef1b5095f0aeadc75f6338848 (patch)
tree3e7a77c27ef305d36de7b4aef68aa6257d7462c6 /Doc
parent3706eef02ab8a176ba4463c164fdb541fb5efae0 (diff)
downloadcpython-4a18a9b4b3cd7d8ef1b5095f0aeadc75f6338848.zip
cpython-4a18a9b4b3cd7d8ef1b5095f0aeadc75f6338848.tar.gz
cpython-4a18a9b4b3cd7d8ef1b5095f0aeadc75f6338848.tar.bz2
[3.12] docs: clarify csv.DictReader's treatment of the first data row (GH-118549) (#118555)
(cherry picked from commit 9d67b72a4952766fdba803eb6eadd41dfee29dff) Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/csv.rst6
1 files changed, 4 insertions, 2 deletions
diff --git a/Doc/library/csv.rst b/Doc/library/csv.rst
index 4ee7820..d174680 100644
--- a/Doc/library/csv.rst
+++ b/Doc/library/csv.rst
@@ -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 will be omitted from the results. If
+ *fieldnames* is provided, they will be used and the first row will be
+ included in the results. Regardless of how the fieldnames are determined,
+ the dictionary preserves their original ordering.
If a row has more fields than fieldnames, the remaining data is put in a
list and stored with the fieldname specified by *restkey* (which defaults