Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Doc/library/socket.rst
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,11 @@ The following functions all create :ref:`socket objects <socket-objects>`.

.. data:: SocketType

This is a Python type object that represents the socket object type. It is the
same as ``type(socket(...))``.
This is the base class for a type object of socket objects, and
``isinstance(socket(...), SocketType)`` returns ``True``.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This is the base class for a type object of socket objects, and
``isinstance(socket(...), SocketType)`` returns ``True``.
This is the base class for socket objects, such that
``isinstance(socket(...), SocketType)`` is ``True``.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your professional advice. As we can see, socket.SocketType is the base class for the type object socket.socket. Consider that elsewhere in this document socket object refers to an instance of the type object socket.socket. Wouldn't it be less precise if we just said that SocketType is the base class of socket objects? Looking forward to your more suggestions.


.. versionchanged:: 3.0
SocketType is now the base class for the socket object type.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SocketType is now the base class for the socket object type.
SocketType is the base class for socket objects
rather than being ``type(socket(...))``` directly.



Other functions
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update documentation for SocketType to align with its implementation.