Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Doc/library/csv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ The :mod:`csv` module defines the following functions:
spamwriter.writerow(['Spam', 'Lovely Spam', 'Wonderful Spam'])


.. function:: register_dialect(name[, dialect[, **fmtparams]])
.. function:: register_dialect(name, /, dialect='excell', **fmtparams)

Associate *dialect* with *name*. *name* must be a string. The
dialect can be specified either by passing a sub-class of :class:`Dialect`, or
Expand All @@ -139,7 +139,8 @@ The :mod:`csv` module defines the following functions:
Return the names of all registered dialects.


.. function:: field_size_limit([new_limit])
.. function:: field_size_limit()
field_size_limit(new_limit)

Returns the current maximum field size allowed by the parser. If *new_limit* is
given, this becomes the new limit.
Expand Down Expand Up @@ -526,7 +527,7 @@ out surrounded by parens. This may cause some problems for other programs which
read CSV files (assuming they support complex numbers at all).


.. method:: csvwriter.writerow(row)
.. method:: csvwriter.writerow(row, /)

Write the *row* parameter to the writer's file object, formatted according
to the current :class:`Dialect`. Return the return value of the call to the
Expand All @@ -535,7 +536,7 @@ read CSV files (assuming they support complex numbers at all).
.. versionchanged:: 3.5
Added support of arbitrary iterables.

.. method:: csvwriter.writerows(rows)
.. method:: csvwriter.writerows(rows, /)

Write all elements in *rows* (an iterable of *row* objects as described
above) to the writer's file object, formatted according to the current
Expand Down
14 changes: 8 additions & 6 deletions Modules/_csv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1304,10 +1304,11 @@ join_append_lineterminator(WriterObj *self)
}

PyDoc_STRVAR(csv_writerow_doc,
"writerow(iterable)\n"
"writerow($self, row, /)\n"
"--\n\n"
"Construct and write a CSV record from an iterable of fields.\n"
"\n"
"Construct and write a CSV record from an iterable of fields. Non-string\n"
"elements will be converted to string.");
"Non-string elements will be converted to string.");

static PyObject *
csv_writerow(PyObject *op, PyObject *seq)
Expand Down Expand Up @@ -1414,10 +1415,11 @@ csv_writerow(PyObject *op, PyObject *seq)
}

PyDoc_STRVAR(csv_writerows_doc,
"writerows(iterable of iterables)\n"
"writerows($self, rows, /)\n"
"--\n\n"
"Construct and write a series of iterables to a csv file.\n"
"\n"
"Construct and write a series of iterables to a csv file. Non-string\n"
"elements will be converted to string.");
"Non-string elements will be converted to string.");

static PyObject *
csv_writerows(PyObject *self, PyObject *seqseq)
Expand Down
Loading