This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Moshe Sambol
Recipients Moshe Sambol, docs@python
Date 2020-03-19.10:37:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1584614250.73.0.590316001908.issue40013@roundup.psfhosted.org>
In-reply-to
Content
The csv.DictReader constructor takes two optional parameters, restkey and restval. restkey is documented well, but restval is not:

"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 to None). If a non-blank row has fewer fields than fieldnames, the missing values are filled-in with None."

Since restval is not mentioned here, the reader may assume that the next sentence applies to it:

"All other optional or keyword arguments are passed to the underlying reader instance."

But this is not the case for restval.

I suggest that the text be amended to 

"If a non-blank row has fewer fields than fieldnames, the missing values are filled-in with the value of restval (which defaults to None)."
History
Date User Action Args
2020-03-19 10:37:30Moshe Sambolsetrecipients: + Moshe Sambol, docs@python
2020-03-19 10:37:30Moshe Sambolsetmessageid: <1584614250.73.0.590316001908.issue40013@roundup.psfhosted.org>
2020-03-19 10:37:30Moshe Sambollinkissue40013 messages
2020-03-19 10:37:30Moshe Sambolcreate