diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2019-10-13 08:59:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-13 08:59:31 (GMT) |
commit | 140a7d1f3579e778656a6b6bfad72489e9870a4d (patch) | |
tree | e9f37d4c49944e9c00e83baaaff6dd785356b29e /Doc | |
parent | 46113e0cf32748f66cf64cd633984d143b433cd1 (diff) | |
download | cpython-140a7d1f3579e778656a6b6bfad72489e9870a4d.zip cpython-140a7d1f3579e778656a6b6bfad72489e9870a4d.tar.gz cpython-140a7d1f3579e778656a6b6bfad72489e9870a4d.tar.bz2 |
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.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/os.rst | 21 |
1 files changed, 12 insertions, 9 deletions
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 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo :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 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo .. versionadded:: 3.3 + .. versionchanged:: 3.9 + Parameters *out* and *in* was renamed to *out_fd* and *in_fd*. + .. function:: set_blocking(fd, blocking) |