https://github.com/python/cpython/commit/4a18a9b4b3cd7d8ef1b5095f0aeadc75f6338848 commit: 4a18a9b4b3cd7d8ef1b5095f0aeadc75f6338848 branch: 3.12 author: Miss Islington (bot) <[email protected]> committer: JelleZijlstra <[email protected]> date: 2024-05-03T15:55:09Z summary:
[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 <[email protected]> files: M Doc/library/csv.rst diff --git a/Doc/library/csv.rst b/Doc/library/csv.rst index 4ee7820585d3a2..d17468023c6de1 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 _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: [email protected]
