restkey=\constant{None}\optional{,
restval=\constant{None}\optional{,
dialect=\code{'excel'}\optional{,
- fmtparam}}}}}}
+ *args, **kwds}}}}}}
Create an object which operates like a regular reader but maps the
information read into a dict whose keys are given by the optional
{} \var{fieldnames}
read has more fields than the fieldnames sequence, the remaining data is
added as a sequence keyed by the value of \var{restkey}. If the row read
has fewer fields than the fieldnames sequence, the remaining keys take the
-value of the optional \var{restval} parameter. All other parameters are
-interpreted as for \class{reader} objects.
+value of the optional \var{restval} parameter. Any other optional or
+keyword arguments are passed to the underlying \class{reader} instance.
\end{classdesc}
\begin{classdesc}{DictWriter}{csvfile, fieldnames\optional{,
restval=""\optional{,
extrasaction=\code{'raise'}\optional{,
- dialect=\code{'excel'}\optional{, fmtparam}}}}}
+ dialect=\code{'excel'}\optional{,
+ *args, **kwds}}}}}
Create an object which operates like a regular writer but maps dictionaries
onto output rows. The \var{fieldnames} parameter identifies the order in
which values in the dictionary passed to the \method{writerow()} method are
method contains a key not found in \var{fieldnames}, the optional
\var{extrasaction} parameter indicates what action to take. If it is set
to \code{'raise'} a \exception{ValueError} is raised. If it is set to
-\code{'ignore'}, extra values in the dictionary are ignored. All other
-parameters are interpreted as for \class{writer} objects.
+\code{'ignore'}, extra values in the dictionary are ignored. Any other
+optional or keyword arguments are passed to the underlying \class{writer}
+instance.
Note that unlike the \class{DictReader} class, the \var{fieldnames}
parameter of the \class{DictWriter} is not optional. Since Python's