[Python-checkins] [3.10] bpo-45772: socket.socket should be a class instead of a function (GH-23960) (GH-29542)

miss-islington webhook-mailer at python.org
Sat Nov 13 01:23:31 EST 2021


https://github.com/python/cpython/commit/3f15792d60011639d9b170d8a76c6db7f6e83665
commit: 3f15792d60011639d9b170d8a76c6db7f6e83665
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2021-11-12T22:23:23-08:00
summary:

[3.10] bpo-45772: socket.socket should be a class instead of a function (GH-23960) (GH-29542)



* [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 <hong at topbug.net>

Automerge-Triggered-By: GH:asvetlov

files:
A Misc/NEWS.d/next/Documentation/2021-11-09-13-10-55.bpo-45772.EdrM3t.rst
M Doc/library/socket.rst

diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
index c69a50266f60f..7ce8e5b0d8038 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 <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 0000000000000..47679521df30b
--- /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.



More information about the Python-checkins mailing list