mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
Issue #16802: Document fileno parameter of socket.socket()
Patch by Henrik Heimbuerger and Bar Harel.
This commit is contained in:
commit
2137dc1573
1 changed files with 5 additions and 1 deletions
|
@ -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>`.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue