Skip to content

Commit 6280a25

Browse files
Improve other signatures.
1 parent 7d473ff commit 6280a25

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

Doc/library/csv.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ The :mod:`csv` module defines the following functions:
113113
spamwriter.writerow(['Spam', 'Lovely Spam', 'Wonderful Spam'])
114114

115115

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

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

141141

142-
.. function:: field_size_limit([new_limit])
142+
.. function:: field_size_limit()
143+
field_size_limit(new_limit)
143144

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

528529

529-
.. method:: csvwriter.writerow(row)
530+
.. method:: csvwriter.writerow(row, /)
530531

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

538-
.. method:: csvwriter.writerows(rows)
539+
.. method:: csvwriter.writerows(rows, /)
539540

540541
Write all elements in *rows* (an iterable of *row* objects as described
541542
above) to the writer's file object, formatted according to the current

Modules/_csv.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,10 +1304,11 @@ join_append_lineterminator(WriterObj *self)
13041304
}
13051305

13061306
PyDoc_STRVAR(csv_writerow_doc,
1307-
"writerow(iterable)\n"
1307+
"writerow($self, row, /)\n"
1308+
"--\n\n"
1309+
"Construct and write a CSV record from an iterable of fields.\n"
13081310
"\n"
1309-
"Construct and write a CSV record from an iterable of fields. Non-string\n"
1310-
"elements will be converted to string.");
1311+
"Non-string elements will be converted to string.");
13111312

13121313
static PyObject *
13131314
csv_writerow(PyObject *op, PyObject *seq)
@@ -1414,10 +1415,11 @@ csv_writerow(PyObject *op, PyObject *seq)
14141415
}
14151416

14161417
PyDoc_STRVAR(csv_writerows_doc,
1417-
"writerows(iterable of iterables)\n"
1418+
"writerows($self, rows, /)\n"
1419+
"--\n\n"
1420+
"Construct and write a series of iterables to a csv file.\n"
14181421
"\n"
1419-
"Construct and write a series of iterables to a csv file. Non-string\n"
1420-
"elements will be converted to string.");
1422+
"Non-string elements will be converted to string.");
14211423

14221424
static PyObject *
14231425
csv_writerows(PyObject *self, PyObject *seqseq)

0 commit comments

Comments
 (0)