Commit 7d978902 authored by Hynek Schlawack's avatar Hynek Schlawack

#14880: Fix kwargs notation in csv.reader, .writer & .register_dialect

Patch by Chris Rebert.
parent 8662c84a
...@@ -57,7 +57,7 @@ Module Contents ...@@ -57,7 +57,7 @@ Module Contents
The :mod:`csv` module defines the following functions: The :mod:`csv` module defines the following functions:
.. function:: reader(csvfile[, dialect='excel'][, fmtparam]) .. function:: reader(csvfile, dialect='excel', **fmtparams)
Return a reader object which will iterate over lines in the given *csvfile*. Return a reader object which will iterate over lines in the given *csvfile*.
*csvfile* can be any object which supports the :term:`iterator` protocol and returns a *csvfile* can be any object which supports the :term:`iterator` protocol and returns a
...@@ -67,7 +67,7 @@ The :mod:`csv` module defines the following functions: ...@@ -67,7 +67,7 @@ The :mod:`csv` module defines the following functions:
*dialect* parameter can be given which is used to define a set of parameters *dialect* parameter can be given which is used to define a set of parameters
specific to a particular CSV dialect. It may be an instance of a subclass of specific to a particular CSV dialect. It may be an instance of a subclass of
the :class:`Dialect` class or one of the strings returned by the the :class:`Dialect` class or one of the strings returned by the
:func:`list_dialects` function. The other optional *fmtparam* keyword arguments :func:`list_dialects` function. The other optional *fmtparams* keyword arguments
can be given to override individual formatting parameters in the current can be given to override individual formatting parameters in the current
dialect. For full details about the dialect and formatting parameters, see dialect. For full details about the dialect and formatting parameters, see
section :ref:`csv-fmt-params`. section :ref:`csv-fmt-params`.
...@@ -94,7 +94,7 @@ The :mod:`csv` module defines the following functions: ...@@ -94,7 +94,7 @@ The :mod:`csv` module defines the following functions:
be split into lines in a manner which preserves the newline characters. be split into lines in a manner which preserves the newline characters.
.. function:: writer(csvfile[, dialect='excel'][, fmtparam]) .. function:: writer(csvfile, dialect='excel', **fmtparams)
Return a writer object responsible for converting the user's data into delimited Return a writer object responsible for converting the user's data into delimited
strings on the given file-like object. *csvfile* can be any object with a strings on the given file-like object. *csvfile* can be any object with a
...@@ -103,7 +103,7 @@ The :mod:`csv` module defines the following functions: ...@@ -103,7 +103,7 @@ The :mod:`csv` module defines the following functions:
parameter can be given which is used to define a set of parameters specific to a parameter can be given which is used to define a set of parameters specific to a
particular CSV dialect. It may be an instance of a subclass of the particular CSV dialect. It may be an instance of a subclass of the
:class:`Dialect` class or one of the strings returned by the :class:`Dialect` class or one of the strings returned by the
:func:`list_dialects` function. The other optional *fmtparam* keyword arguments :func:`list_dialects` function. The other optional *fmtparams* keyword arguments
can be given to override individual formatting parameters in the current can be given to override individual formatting parameters in the current
dialect. For full details about the dialect and formatting parameters, see dialect. For full details about the dialect and formatting parameters, see
section :ref:`csv-fmt-params`. To make it section :ref:`csv-fmt-params`. To make it
...@@ -122,11 +122,11 @@ The :mod:`csv` module defines the following functions: ...@@ -122,11 +122,11 @@ The :mod:`csv` module defines the following functions:
>>> spamWriter.writerow(['Spam', 'Lovely Spam', 'Wonderful Spam']) >>> spamWriter.writerow(['Spam', 'Lovely Spam', 'Wonderful Spam'])
.. function:: register_dialect(name[, dialect][, fmtparam]) .. function:: register_dialect(name[, dialect], **fmtparams)
Associate *dialect* with *name*. *name* must be a string or Unicode object. The Associate *dialect* with *name*. *name* must be a string or Unicode object. The
dialect can be specified either by passing a sub-class of :class:`Dialect`, or dialect can be specified either by passing a sub-class of :class:`Dialect`, or
by *fmtparam* keyword arguments, or both, with keyword arguments overriding by *fmtparams* keyword arguments, or both, with keyword arguments overriding
parameters of the dialect. For full details about the dialect and formatting parameters of the dialect. For full details about the dialect and formatting
parameters, see section :ref:`csv-fmt-params`. parameters, see section :ref:`csv-fmt-params`.
......
...@@ -378,6 +378,9 @@ Build ...@@ -378,6 +378,9 @@ Build
Documentation Documentation
------------- -------------
- Issue #14880: Fix kwargs notation in csv.reader, .writer & .register_dialect.
Patch by Chris Rebert.
- Issue #14674: Add a discussion of the json module's standard compliance. - Issue #14674: Add a discussion of the json module's standard compliance.
Patch by Chris Rebert. Patch by Chris Rebert.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment