diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2024-05-03 15:48:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-03 15:48:27 (GMT) |
commit | 9d67b72a4952766fdba803eb6eadd41dfee29dff (patch) | |
tree | 278c2eeea1bc3e951b77c2c53ebe20b01c544b0b | |
parent | 608192ee2f6c60aaae1c6f2f64ea45ad2667ff2d (diff) | |
download | cpython-9d67b72a4952766fdba803eb6eadd41dfee29dff.zip cpython-9d67b72a4952766fdba803eb6eadd41dfee29dff.tar.gz cpython-9d67b72a4952766fdba803eb6eadd41dfee29dff.tar.bz2 |
docs: clarify csv.DictReader's treatment of the first data row (#118549)
-rw-r--r-- | Doc/library/csv.rst | 6 |
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 |