From 0964fe4616a3b7b677a61841d04805a3dab1f61b Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Sat, 26 Dec 2020 20:50:55 -0800 Subject: [PATCH 1/2] bpo-45772: socket.socket should be a class instead of a function Currently `socket.socket` is documented as a function, but it is really a class (and thus has function-like usage to construct an object). This correction would ensure that Python projects that are interlinking Python's documentation can properly locate `socket.socket` as a type. --- Doc/library/socket.rst | 2 +- .../next/Documentation/2021-11-09-13-10-55.bpo-45772.EdrM3t.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Documentation/2021-11-09-13-10-55.bpo-45772.EdrM3t.rst diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 831821bbda77c8..d6edc057f5e9cc 100755 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -562,7 +562,7 @@ Creating sockets The following functions all create :ref:`socket objects `. -.. function:: socket(family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None) +.. class:: socket(family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None) Create a new socket using the given address family, socket type and protocol number. The address family should be :const:`AF_INET` (the default), diff --git a/Misc/NEWS.d/next/Documentation/2021-11-09-13-10-55.bpo-45772.EdrM3t.rst b/Misc/NEWS.d/next/Documentation/2021-11-09-13-10-55.bpo-45772.EdrM3t.rst new file mode 100644 index 00000000000000..dd9516a8e4379d --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2021-11-09-13-10-55.bpo-45772.EdrM3t.rst @@ -0,0 +1 @@ +``socket.socket`` is corrected to a class from a function. From d81f63a678edb413dba86a3a302a82f1cc737969 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Sat, 13 Nov 2021 07:43:14 +0200 Subject: [PATCH 2/2] Update Misc/NEWS.d/next/Documentation/2021-11-09-13-10-55.bpo-45772.EdrM3t.rst --- .../next/Documentation/2021-11-09-13-10-55.bpo-45772.EdrM3t.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Documentation/2021-11-09-13-10-55.bpo-45772.EdrM3t.rst b/Misc/NEWS.d/next/Documentation/2021-11-09-13-10-55.bpo-45772.EdrM3t.rst index dd9516a8e4379d..47679521df30b1 100644 --- a/Misc/NEWS.d/next/Documentation/2021-11-09-13-10-55.bpo-45772.EdrM3t.rst +++ b/Misc/NEWS.d/next/Documentation/2021-11-09-13-10-55.bpo-45772.EdrM3t.rst @@ -1 +1 @@ -``socket.socket`` is corrected to a class from a function. +``socket.socket`` documentation is corrected to a class from a function.