Skip to content

gh-71566: Fix SocketType introduction in the socket documentation. #93288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

xiaochen7
Copy link
Contributor

@xiaochen7 xiaochen7 commented May 27, 2022

In the previous commit, SocketType was changed to the base class for the socket object type.

The purpose of this PR is to align the documentation with the above modifications.

@ghost
Copy link

ghost commented May 27, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@bedevere-bot bedevere-bot added docs Documentation in the Doc dir awaiting review labels May 27, 2022
@AA-Turner
Copy link
Member

You don't need NEWS, please delete it.

A

@AA-Turner AA-Turner added needs backport to 3.10 only security fixes needs backport to 3.11 only security fixes labels May 27, 2022
Copy link
Member

@AA-Turner AA-Turner left a comment

Choose a reason for hiding this comment

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

Two wording suggestions.

A

Comment on lines 829 to 830
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.

``isinstance(socket(...), SocketType)`` returns ``True``.

.. 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.

@serhiy-storchaka serhiy-storchaka added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes and removed needs backport to 3.10 only security fixes needs backport to 3.11 only security fixes labels May 9, 2024
@hugovk hugovk removed the needs backport to 3.12 only security fixes label Apr 10, 2025
@serhiy-storchaka serhiy-storchaka added the needs backport to 3.14 bugs and security fixes label May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting core review docs Documentation in the Doc dir needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes skip news
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

6 participants