summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2015-10-08 03:34:57 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2015-10-08 03:34:57 (GMT)
commit2137dc15737e286e576d69ad10124973c3f9ba1e (patch)
tree12ea8a51ebbb88b50d2ba3586e257c232c02e054 /Doc
parentc2432f6edbec7a8cc1021d2f4fe625ba92dc8ac4 (diff)
parentce88d82ec26877e0fcd6c7ebe0a1b72dccd3a833 (diff)
downloadcpython-2137dc15737e286e576d69ad10124973c3f9ba1e.zip
cpython-2137dc15737e286e576d69ad10124973c3f9ba1e.tar.gz
cpython-2137dc15737e286e576d69ad10124973c3f9ba1e.tar.bz2
Issue #16802: Document fileno parameter of socket.socket()
Patch by Henrik Heimbuerger and Bar Harel.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/socket.rst6
1 files changed, 5 insertions, 1 deletions
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
index e583ebd..f7b7d3d 100644
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -384,7 +384,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>`.