GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [doc] SocketType changed in Python 3 · Issue #71566 · python/cpython

[doc] SocketType changed in Python 3 #71566

New issue
Copy link
New issue
Copy link
Closed as duplicate
Closed as duplicate
[doc] SocketType changed in Python 3#71566
Copy link
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dirtopic-socketRelated to the socket, socketserver and selectors modulesRelated to the socket, socketserver and selectors modules

Description

@vadmium
vadmium
opened on Jun 24, 2016
Issue body actions
BPO 27379
Nosy @vadmium, @shihai1991
PRs
  • bpo-27379: In order to keep backward compatibility, update SocketType's type #14710
  • 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 = None
    created_at = <Date 2016-06-24.03:19:57.757>
    labels = ['3.8', '3.9']
    title = 'SocketType changed in Python 3'
    updated_at = <Date 2020-01-17.12:28:51.267>
    user = 'https://github.com/vadmium'

    bugs.python.org fields:

    activity = <Date 2020-01-17.12:28:51.267>
    actor = 'cheryl.sabella'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = []
    creation = <Date 2016-06-24.03:19:57.757>
    creator = 'martin.panter'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 27379
    keywords = ['patch']
    message_count = 3.0
    messages = ['269153', '347691', '349126']
    nosy_count = 2.0
    nosy_names = ['martin.panter', 'shihai1991']
    pr_nums = ['14710']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue27379'
    versions = ['Python 3.8', 'Python 3.9']

    Linked PRs

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

    Activity

    1. vadmium commented on Jun 24, 2016

      @vadmium
      vadmium
      on Jun 24, 2016
      MemberAuthor
      More actions

      In the documentation for Python 2 and 3, socket.SocketType is defined as:

      This is a Python type object that represents the socket object type. It is the same as “type(socket(...))”.

      In Python 2 it is a standalone “socket._socketobject” class, which holds a “_socket.socket” instance as an internal “_sock” attribute. So the documentation and implementation are consistent. But since revision 8e062e572ea4, Python 3 no longer defines SocketType directly, and just imports the “_socket.SocketType” definition, which is an alias of “_socket.socket”. The change also defines “socket.socket” as a subclass of this low-level class. The result is that SocketType is not the exact type, but only a base class:

      >>> s = socket.socket()
      >>> type(s)
      <class 'socket.socket' at 0x2347d48>
      >>> SocketType
      <class '_socket.socket' at 0x7ff9e2522280>
      >>> type(s) is SocketType  # Should be true according to documentation
      False
      >>> isinstance(s, SocketType)
      True

      Should the documentation just be amended, or should SocketType be changed? If SocketType is not changed, perhaps we should document that socket.socket() is a class, not just a function, and maybe deprecate SocketType.

    2. shihai1991 commented on Jul 11, 2019

      @shihai1991
      shihai1991
      on Jul 11, 2019
      Member
      More actions

      In order to keep back compatible, I would prefer to update SocketType ;)

    3. shihai1991 commented on Aug 6, 2019

      @shihai1991
      shihai1991
      on Aug 6, 2019
      Member
      More actions

      ping

    4. csabella
      added
      3.8 (EOL)end of lifeend of life
      3.9 (EOL)end of lifeend of life
      on Jan 17, 2020
    5. ezio-melotti
      transferred this issue fromon Apr 10, 2022
    6. iritkatriel commented on May 19, 2022

      @iritkatriel
      iritkatriel
      on May 19, 2022
      Member
      More actions

      I don't think backwards compatibility with python 2 matters anymore. A doc fix should do.

    7. iritkatriel
      added
      easy
      on May 19, 2022
    8. iritkatriel
      changed the title [-]SocketType changed in Python 3[/-] [+][doc] SocketType changed in Python 3[/+] on May 19, 2022
    9. iritkatriel
      added
      docsDocumentation in the Doc dirDocumentation in the Doc dir
      3.11only security fixesonly security fixes
      3.10 (EOL)end of lifeend of life
      3.12only security fixesonly security fixes
      and removed
      3.9 (EOL)end of lifeend of life
      3.8 (EOL)end of lifeend of life
      on May 19, 2022
    10. shihai1991 commented on May 26, 2022

      @shihai1991
      shihai1991
      on May 26, 2022
      Member
      More actions

      I don't think backwards compatibility with python 2 matters anymore. A doc fix should do.

      Agree. I closed #14710.

    11. xiaochen7
      added a commit that references this issue on May 27, 2022

      pythongh-71566: Fix SocketType introduction in the socket documentation.

      7d9e9d7
    12. xiaochen7 commented on May 27, 2022

      @xiaochen7
      xiaochen7
      on May 27, 2022
      Contributor
      More actions

      In the previous commit, the SocketType was changed to the base class for the Socket object type. I created a PR to update the SocketType documentation. Please correct me if there is a different opinion.

    13. StanFromIreland
      removed
      3.11only security fixesonly security fixes
      3.10 (EOL)end of lifeend of life
      3.12only security fixesonly security fixes
      on Dec 29, 2025
    14. github-project-automation
      moved this to Todo in docs issueson Dec 29, 2025
    15. github-project-automation
      added this to docs issueson Dec 29, 2025
    16. picnixz
      removed
      easy
      on Dec 30, 2025
    17. serhiy-storchaka
      added
      topic-socketRelated to the socket, socketserver and selectors modulesRelated to the socket, socketserver and selectors modules
      on Jul 3, 2026
    18. aisk commented on Sep 6, 2026

      @aisk
      aisk
      on Sep 6, 2026
      Member
      More actions

      This was covered by #150683.

    19. aisk
      closed this as duplicateon Sep 6, 2026
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      docsDocumentation in the Doc dirDocumentation in the Doc dirtopic-socketRelated to the socket, socketserver and selectors modulesRelated to the socket, socketserver and selectors modules

      Projects

      • docs issues
        Status
        Todo
        Show more project fields

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.