summaryrefslogtreecommitdiffstats
path: root/Doc/library/socket.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/socket.rst')
-rw-r--r--Doc/library/socket.rst22
1 files changed, 22 insertions, 0 deletions
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
index 42fd7ea..db032ca 100644
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -482,6 +482,20 @@ The following functions all create :ref:`socket objects <socket-objects>`.
.. versionchanged:: 3.7
The CAN_ISOTP protocol was added.
+ .. versionchanged:: 3.7
+ When :const:`SOCK_NONBLOCK` or :const:`SOCK_CLOEXEC`
+ bit flags are applied to *type* they are cleared, and
+ :attr:`socket.type` will not reflect them. They are still passed
+ to the underlying system `socket()` call. Therefore::
+
+ sock = socket.socket(
+ socket.AF_INET,
+ socket.SOCK_STREAM | socket.SOCK_NONBLOCK)
+
+ will still create a non-blocking socket on OSes that support
+ ``SOCK_NONBLOCK``, but ``sock.type`` will be set to
+ ``socket.SOCK_STREAM``.
+
.. function:: socketpair([family[, type[, proto]]])
Build a pair of connected socket objects using the given address family, socket
@@ -1417,6 +1431,10 @@ to sockets.
* ``sock.setblocking(False)`` is equivalent to ``sock.settimeout(0.0)``
+ .. versionchanged:: 3.7
+ The method no longer applies :const:`SOCK_NONBLOCK` flag on
+ :attr:`socket.type`.
+
.. method:: socket.settimeout(value)
@@ -1429,6 +1447,10 @@ to sockets.
For further information, please consult the :ref:`notes on socket timeouts <socket-timeouts>`.
+ .. versionchanged:: 3.7
+ The method no longer toggles :const:`SOCK_NONBLOCK` flag on
+ :attr:`socket.type`.
+
.. method:: socket.setsockopt(level, optname, value: int)
.. method:: socket.setsockopt(level, optname, value: buffer)