]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45772: socket.socket should be a class instead of a function (GH-23960)
authorHong Xu <hong@topbug.net>
Sat, 13 Nov 2021 06:02:04 +0000 (22:02 -0800)
committerGitHub <noreply@github.com>
Sat, 13 Nov 2021 06:02:04 +0000 (08:02 +0200)
* 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
Misc/NEWS.d/next/Documentation/2021-11-09-13-10-55.bpo-45772.EdrM3t.rst [new file with mode: 0644]

index 831821bbda77c8cd746045f95295c497287b6911..d6edc057f5e9cce3df68031ee31f49108c9041ec 100755 (executable)
@@ -562,7 +562,7 @@ Creating sockets
 The following functions all create :ref:`socket objects <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 (file)
index 0000000..4767952
--- /dev/null
@@ -0,0 +1 @@
+``socket.socket`` documentation is corrected to a class from a function.