Skip to content

Commit 178c419

Browse files
slatenyJelleZijlstra
authored andcommitted
[3.9] pythongh-85864: Mark positional-only args in io docs (pythonGH-91683).
(cherry picked from commit a3f2cf3) Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
1 parent 42a158b commit 178c419

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

‎Doc/library/io.rst‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ I/O Base Classes
299299
Return ``True`` if the stream can be read from. If ``False``, :meth:`read`
300300
will raise :exc:`OSError`.
301301

302-
.. method:: readline(size=-1)
302+
.. method:: readline(size=-1, /)
303303

304304
Read and return one line from the stream. If *size* is specified, at
305305
most *size* bytes will be read.
@@ -308,7 +308,7 @@ I/O Base Classes
308308
the *newline* argument to :func:`open` can be used to select the line
309309
terminator(s) recognized.
310310

311-
.. method:: readlines(hint=-1)
311+
.. method:: readlines(hint=-1, /)
312312

313313
Read and return a list of lines from the stream. *hint* can be specified
314314
to control the number of lines read: no more lines will be read if the
@@ -394,7 +394,7 @@ I/O Base Classes
394394
:class:`RawIOBase` provides these methods in addition to those from
395395
:class:`IOBase`:
396396

397-
.. method:: read(size=-1)
397+
.. method:: read(size=-1, /)
398398

399399
Read up to *size* bytes from the object and return them. As a convenience,
400400
if *size* is unspecified or -1, all bytes until EOF are returned.
@@ -504,7 +504,7 @@ I/O Base Classes
504504
If *size* is ``-1`` (the default), an arbitrary number of bytes are
505505
returned (more than zero unless EOF is reached).
506506

507-
.. method:: readinto(b)
507+
.. method:: readinto(b, /)
508508

509509
Read bytes into a pre-allocated, writable
510510
:term:`bytes-like object` *b* and return the number of bytes read.
@@ -516,7 +516,7 @@ I/O Base Classes
516516
A :exc:`BlockingIOError` is raised if the underlying raw stream is in non
517517
blocking-mode, and has no data available at the moment.
518518

519-
.. method:: readinto1(b)
519+
.. method:: readinto1(b, /)
520520

521521
Read bytes into a pre-allocated, writable
522522
:term:`bytes-like object` *b*, using at most one call to
@@ -646,7 +646,7 @@ than raw I/O does.
646646
Return :class:`bytes` containing the entire contents of the buffer.
647647

648648

649-
.. method:: read1([size])
649+
.. method:: read1([size], /)
650650

651651
In :class:`BytesIO`, this is the same as :meth:`~BufferedIOBase.read`.
652652

@@ -724,7 +724,7 @@ than raw I/O does.
724724
Force bytes held in the buffer into the raw stream. A
725725
:exc:`BlockingIOError` should be raised if the raw stream blocks.
726726

727-
.. method:: write(b)
727+
.. method:: write(b, /)
728728

729729
Write the :term:`bytes-like object`, *b*, and return the
730730
number of bytes written. When in non-blocking mode, a
@@ -747,7 +747,7 @@ than raw I/O does.
747747
are guaranteed to be implemented.
748748

749749

750-
.. class:: BufferedRWPair(reader, writer, buffer_size=DEFAULT_BUFFER_SIZE)
750+
.. class:: BufferedRWPair(reader, writer, buffer_size=DEFAULT_BUFFER_SIZE, /)
751751

752752
A buffered binary stream providing higher-level access to two non seekable
753753
:class:`RawIOBase` raw binary streams---one readable, the other writeable.
@@ -814,7 +814,7 @@ Text I/O
814814

815815
.. versionadded:: 3.1
816816

817-
.. method:: read(size=-1)
817+
.. method:: read(size=-1, /)
818818

819819
Read and return at most *size* characters from the stream as a single
820820
:class:`str`. If *size* is negative or ``None``, reads until EOF.

0 commit comments

Comments
 (0)