Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
ab86521a
Commit
ab86521a
authored
Apr 22, 2019
by
Marcin Niemira
Committed by
Inada Naoki
Apr 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-36523: Add docstring to io.IOBase.writelines (GH-12683)
parent
662ebd2a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
3 deletions
+18
-3
Lib/_pyio.py
Lib/_pyio.py
+5
-0
Misc/NEWS.d/next/Documentation/2019-04-04-19-11-47.bpo-36523.sG1Tr4.rst
...xt/Documentation/2019-04-04-19-11-47.bpo-36523.sG1Tr4.rst
+1
-0
Modules/_io/clinic/iobase.c.h
Modules/_io/clinic/iobase.c.h
+6
-2
Modules/_io/iobase.c
Modules/_io/iobase.c
+6
-1
No files found.
Lib/_pyio.py
View file @
ab86521a
...
...
@@ -551,6 +551,11 @@ class IOBase(metaclass=abc.ABCMeta):
return
lines
def
writelines
(
self
,
lines
):
"""Write a list of lines to the stream.
Line separators are not added, so it is usual for each of the lines
provided to have a line separator at the end.
"""
self
.
_checkClosed
()
for
line
in
lines
:
self
.
write
(
line
)
...
...
Misc/NEWS.d/next/Documentation/2019-04-04-19-11-47.bpo-36523.sG1Tr4.rst
0 → 100644
View file @
ab86521a
Add docstring for io.IOBase.writelines().
Modules/_io/clinic/iobase.c.h
View file @
ab86521a
...
...
@@ -242,7 +242,11 @@ exit:
PyDoc_STRVAR
(
_io__IOBase_writelines__doc__
,
"writelines($self, lines, /)
\n
"
"--
\n
"
"
\n
"
);
"
\n
"
"Write a list of lines to stream.
\n
"
"
\n
"
"Line separators are not added, so it is usual for each of the
\n
"
"lines provided to have a line separator at the end."
);
#define _IO__IOBASE_WRITELINES_METHODDEF \
{"writelines", (PyCFunction)_io__IOBase_writelines, METH_O, _io__IOBase_writelines__doc__},
...
...
@@ -311,4 +315,4 @@ _io__RawIOBase_readall(PyObject *self, PyObject *Py_UNUSED(ignored))
{
return
_io__RawIOBase_readall_impl
(
self
);
}
/*[clinic end generated code: output=6
0e43a7cbd9f314e
input=a9049054013a1b77]*/
/*[clinic end generated code: output=6
1b6ea7153ef9940
input=a9049054013a1b77]*/
Modules/_io/iobase.c
View file @
ab86521a
...
...
@@ -751,11 +751,16 @@ _io__IOBase_readlines_impl(PyObject *self, Py_ssize_t hint)
_io._IOBase.writelines
lines: object
/
Write a list of lines to stream.
Line separators are not added, so it is usual for each of the
lines provided to have a line separator at the end.
[clinic start generated code]*/
static
PyObject
*
_io__IOBase_writelines
(
PyObject
*
self
,
PyObject
*
lines
)
/*[clinic end generated code: output=976eb0a9b60a6628 input=
432e729a8450b3cb
]*/
/*[clinic end generated code: output=976eb0a9b60a6628 input=
cac3fc8864183359
]*/
{
PyObject
*
iter
,
*
res
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment