Skip to content

Commit 8dcbf79

Browse files
xuhdevmiss-islington
authored andcommitted
bpo-45772: socket.socket should be a class instead of a function (pythonGH-23960)
* 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 <hong@topbug.net>
1 parent 10b0c67 commit 8dcbf79

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

Doc/library/socket.rst

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

509509

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

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