Skip to content

Commit 3f15792

Browse files
[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 4c792f3) Co-authored-by: Hong Xu <[email protected]> Automerge-Triggered-By: GH:asvetlov
1 parent e4c5a5e commit 3f15792

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Doc/library/socket.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ Creating sockets
562562
The following functions all create :ref:`socket objects <socket-objects>`.
563563

564564

565-
.. function:: socket(family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None)
565+
.. class:: socket(family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None)
566566

567567
Create a new socket using the given address family, socket type and protocol
568568
number. The address family should be :const:`AF_INET` (the default),
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
``socket.socket`` documentation is corrected to a class from a function.

0 commit comments

Comments
 (0)