Skip to content

Commit

Permalink
docs: clarify csv.DictReader's treatment of the first data row (pytho…
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed May 3, 2024
1 parent 608192e commit 9d67b72
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Doc/library/csv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9d67b72

Please sign in to comment.