diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2015-10-08 03:34:01 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2015-10-08 03:34:01 (GMT) |
commit | 24a610984da381008237de6c3165b4e0aa4ec10c (patch) | |
tree | 1ab1fca728eb598dbcc4185f498bfaf4231ac38e /Doc/library | |
parent | 9955a373a8ae5a3ac9108afc436199277fdedff7 (diff) | |
download | cpython-24a610984da381008237de6c3165b4e0aa4ec10c.zip cpython-24a610984da381008237de6c3165b4e0aa4ec10c.tar.gz cpython-24a610984da381008237de6c3165b4e0aa4ec10c.tar.bz2 |
Issue #16802: Document fileno parameter of socket.socket()
Patch by Henrik Heimbuerger and Bar Harel.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/socket.rst | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 271dda8..638a77e 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -369,7 +369,11 @@ The following functions all create :ref:`socket objects <socket-objects>`. :const:`SOCK_DGRAM`, :const:`SOCK_RAW` or perhaps one of the other ``SOCK_`` constants. The protocol number is usually zero and may be omitted or in the case where the address family is :const:`AF_CAN` the protocol should be one - of :const:`CAN_RAW` or :const:`CAN_BCM`. + of :const:`CAN_RAW` or :const:`CAN_BCM`. If *fileno* is specified, the other + arguments are ignored, causing the socket with the specified file descriptor + to return. Unlike :func:`socket.fromfd`, *fileno* will return the same + socket and not a duplicate. This may help close a detached socket using + :meth:`socket.close()`. The newly created socket is :ref:`non-inheritable <fd_inheritance>`. |