Skip to content
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

socket.socket should be a class instead of a function #89930

Closed
arhadthedev opened this issue Nov 9, 2021 · 5 comments
Closed

socket.socket should be a class instead of a function #89930

arhadthedev opened this issue Nov 9, 2021 · 5 comments
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@arhadthedev
Copy link
Member

BPO 45772
Nosy @terryjreedy, @pitrou, @asvetlov, @miss-islington, @arhadthedev
PRs
  • bpo-45772: socket.socket should be a class instead of a function #23960
  • [3.10] bpo-45772: socket.socket should be a class instead of a function (GH-23960) #29542
  • [3.9] bpo-45772: socket.socket should be a class instead of a function (GH-23960) #29543
  • [3.8] bpo-45772: socket.socket should be a class instead of a function (GH-23960) #29544
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-11-13.06:20:12.578>
    created_at = <Date 2021-11-09.19:55:56.174>
    labels = ['3.11', 'type-bug', '3.9', '3.10', 'docs']
    title = 'socket.socket should be a class instead of a function'
    updated_at = <Date 2021-11-13.06:29:08.115>
    user = 'https://github.com/arhadthedev'

    bugs.python.org fields:

    activity = <Date 2021-11-13.06:29:08.115>
    actor = 'miss-islington'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2021-11-13.06:20:12.578>
    closer = 'arhadthedev'
    components = ['Documentation']
    creation = <Date 2021-11-09.19:55:56.174>
    creator = 'arhadthedev'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 45772
    keywords = ['patch']
    message_count = 5.0
    messages = ['406045', '406246', '406268', '406269', '406270']
    nosy_count = 7.0
    nosy_names = ['terry.reedy', 'pitrou', 'asvetlov', 'docs@python', 'xuhdev', 'miss-islington', 'arhadthedev']
    pr_nums = ['23960', '29542', '29543', '29544']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue45772'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    @arhadthedev
    Copy link
    Member Author

    Found a twice stale bpo-less but useful pull request 23960, so publish it here:

    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.

    @arhadthedev arhadthedev added 3.7 (EOL) end of life 3.8 (EOL) end of life 3.10 only security fixes 3.11 only security fixes 3.9 only security fixes labels Nov 9, 2021
    @arhadthedev arhadthedev added docs Documentation in the Doc dir 3.7 (EOL) end of life 3.8 (EOL) end of life 3.10 only security fixes 3.11 only security fixes 3.9 only security fixes labels Nov 9, 2021
    @arhadthedev arhadthedev added the docs Documentation in the Doc dir label Nov 9, 2021
    @terryjreedy
    Copy link
    Member

    Filter, map, and zip are documented as functions to allow other interpreters to implement them as such, with generator functions. That does not apply here, but maybe there is another reason for socket being called a 'function.

    Antoine, git blame credits you with socket.rst, line 565
    .. function:: socket(family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None)
    https://docs.python.org/3/library/socket.html#socket.socket

    PR-23960 changes 'function' to 'class'. What do you think?

    @terryjreedy terryjreedy added type-bug An unexpected behavior, bug, or error and removed 3.7 (EOL) end of life 3.8 (EOL) end of life labels Nov 12, 2021
    @asvetlov
    Copy link
    Contributor

    New changeset 4c792f3 by Hong Xu in branch 'main':
    bpo-45772: socket.socket should be a class instead of a function (GH-23960)
    4c792f3

    @miss-islington
    Copy link
    Contributor

    New changeset 3f15792 by Miss Islington (bot) in branch '3.10':
    [3.10] bpo-45772: socket.socket should be a class instead of a function (GH-23960) (GH-29542)
    3f15792

    @miss-islington
    Copy link
    Contributor

    New changeset b952f60 by Miss Islington (bot) in branch '3.9':
    [3.9] bpo-45772: socket.socket should be a class instead of a function (GH-23960) (GH-29543)
    b952f60

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes 3.10 only security fixes 3.11 only security fixes docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants