From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sat, 13 Nov 2021 06:29:01 +0000 (-0800) Subject: [3.9] bpo-45772: socket.socket should be a class instead of a function (GH-23960... X-Git-Tag: v3.9.9~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b952f60213c60f89a50e4538783a18ced64ca91f;p=thirdparty%2FPython%2Fcpython.git [3.9] bpo-45772: socket.socket should be a class instead of a function (GH-23960) (GH-29543) * [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. (cherry picked from commit 4c792f39e688b11c7c19e411ed4f76a7baa44638) Co-authored-by: Hong Xu Automerge-Triggered-By: GH:asvetlov --- diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index db94a2a12457..f0a1338e2b85 100755 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -552,7 +552,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 000000000000..47679521df30 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2021-11-09-13-10-55.bpo-45772.EdrM3t.rst @@ -0,0 +1 @@ +``socket.socket`` documentation is corrected to a class from a function.