Skip to content

Commit

Permalink
[3.9] bpo-45772: socket.socket should be a class instead of a function (
Browse files Browse the repository at this point in the history
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 <hong@topbug.net>

Automerge-Triggered-By: GH:asvetlov
  • Loading branch information
miss-islington committed Nov 13, 2021
1 parent 587ff7f commit b952f60
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Doc/library/socket.rst
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,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),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``socket.socket`` documentation is corrected to a class from a function.

0 comments on commit b952f60

Please sign in to comment.