mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
gh-76728: Coerce DictReader and DictWriter fieldnames argument to a list (GH-32225)
This commit is contained in:
parent
c09fa7542c
commit
cd492d43a2
4 changed files with 37 additions and 0 deletions
|
@ -167,6 +167,8 @@ The :mod:`csv` module defines the following classes:
|
|||
All other optional or keyword arguments are passed to the underlying
|
||||
:class:`reader` instance.
|
||||
|
||||
If the argument passed to *fieldnames* is an iterator, it will be coerced to a :class:`list`.
|
||||
|
||||
.. versionchanged:: 3.6
|
||||
Returned rows are now of type :class:`OrderedDict`.
|
||||
|
||||
|
@ -209,6 +211,8 @@ The :mod:`csv` module defines the following classes:
|
|||
Note that unlike the :class:`DictReader` class, the *fieldnames* parameter
|
||||
of the :class:`DictWriter` class is not optional.
|
||||
|
||||
If the argument passed to *fieldnames* is an iterator, it will be coerced to a :class:`list`.
|
||||
|
||||
A short usage example::
|
||||
|
||||
import csv
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue