Skip to content

Commit b952f60

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

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
@@ -552,7 +552,7 @@ Creating sockets
552552
The following functions all create :ref:`socket objects <socket-objects>`.
553553

554554

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

557557
Create a new socket using the given address family, socket type and protocol
558558
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)