bpo-38378: Rename parameters "out" and "in" of os.sendfile(). (GH-16742)
They conflicted with keyword "in".
Also rename positional-only parameters of private os._fcopyfile()
for consistency.
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index 67fe36b..fe9531b 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -1251,27 +1251,27 @@
:exc:`InterruptedError` exception (see :pep:`475` for the rationale).
-.. function:: sendfile(out, in, offset, count)
- sendfile(out, in, offset, count, [headers], [trailers], flags=0)
+.. function:: sendfile(out_fd, in_fd, offset, count)
+ sendfile(out_fd, in_fd, offset, count, [headers], [trailers], flags=0)
- Copy *count* bytes from file descriptor *in* to file descriptor *out*
+ Copy *count* bytes from file descriptor *in_fd* to file descriptor *out_fd*
starting at *offset*.
- Return the number of bytes sent. When EOF is reached return 0.
+ Return the number of bytes sent. When EOF is reached return ``0``.
The first function notation is supported by all platforms that define
:func:`sendfile`.
On Linux, if *offset* is given as ``None``, the bytes are read from the
- current position of *in* and the position of *in* is updated.
+ current position of *in_fd* and the position of *in_fd* is updated.
The second case may be used on Mac OS X and FreeBSD where *headers* and
*trailers* are arbitrary sequences of buffers that are written before and
- after the data from *in* is written. It returns the same as the first case.
+ after the data from *in_fd* is written. It returns the same as the first case.
- On Mac OS X and FreeBSD, a value of 0 for *count* specifies to send until
- the end of *in* is reached.
+ On Mac OS X and FreeBSD, a value of ``0`` for *count* specifies to send until
+ the end of *in_fd* is reached.
- All platforms support sockets as *out* file descriptor, and some platforms
+ All platforms support sockets as *out_fd* file descriptor, and some platforms
allow other types (e.g. regular file, pipe) as well.
Cross-platform applications should not use *headers*, *trailers* and *flags*
@@ -1286,6 +1286,9 @@
.. versionadded:: 3.3
+ .. versionchanged:: 3.9
+ Parameters *out* and *in* was renamed to *out_fd* and *in_fd*.
+
.. function:: set_blocking(fd, blocking)