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.AddressFamily is absent in pydoc output #64888

Closed
serhiy-storchaka opened this issue Feb 19, 2014 · 10 comments
Closed

socket.AddressFamily is absent in pydoc output #64888

serhiy-storchaka opened this issue Feb 19, 2014 · 10 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

BPO 20689
Nosy @vstinner, @ethanfurman, @serhiy-storchaka, @vajrasky
Files
  • socket.AddressFamily.html
  • socket.SocketType.html
  • socket.html
  • pydoc_display_AddressFamily.patch
  • socket__all__.patch
  • 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 = 'https://github.com/serhiy-storchaka'
    closed_at = <Date 2014-10-18.22:13:16.969>
    created_at = <Date 2014-02-19.21:43:51.896>
    labels = ['type-bug', 'library']
    title = 'socket.AddressFamily is absent in pydoc output'
    updated_at = <Date 2014-10-18.22:13:16.968>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2014-10-18.22:13:16.968>
    actor = 'ethan.furman'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2014-10-18.22:13:16.969>
    closer = 'ethan.furman'
    components = ['Library (Lib)']
    creation = <Date 2014-02-19.21:43:51.896>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['35336', '35337', '35338', '35379', '35380']
    hgrepos = []
    issue_num = 20689
    keywords = ['patch']
    message_count = 10.0
    messages = ['211662', '219029', '219030', '219218', '219226', '219227', '219228', '219291', '229632', '229663']
    nosy_count = 5.0
    nosy_names = ['vstinner', 'ethan.furman', 'python-dev', 'serhiy.storchaka', 'vajrasky']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue20689'
    versions = ['Python 3.4', 'Python 3.5']

    @serhiy-storchaka
    Copy link
    Member Author

    The documentation for socket.AddressFamily (unlike to SocketType) isn't generated in html page by pydoc.

    May be bpo-20654 is similar to this issue.

    @serhiy-storchaka serhiy-storchaka added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Feb 19, 2014
    @berkerpeksag
    Copy link
    Member

    I couldn't reproduce this issue. I'm attaching HTML output of both socket.AddressFamily and socket.SocketType enum types.

    @serhiy-storchaka
    Copy link
    Member Author

    Try "./python -m pydoc -w socket".

    @vajrasky
    Copy link
    Mannequin

    vajrasky mannequin commented May 27, 2014

    I found the culprit. The AddressFamily is not registered in _socket module. I created a preliminary patch to show the culprit.

    @vstinner
    Copy link
    Member

    "I found the culprit. The AddressFamily is not registered in _socket module. I created a preliminary patch to show the culprit."

    That's not surprising, this type is created in socket (socket.py), not in _socket (the C module). Your patch is wrong.

    @serhiy-storchaka
    Copy link
    Member Author

    Ah, now I see what is wrong.

    Actually AddressFamily is missing in text output of pydoc too. Because "AddressFamily" is not included in the __all__ list. SocketType is included, but this is different SocketType, SocketType from _socket (see bpo-20386).

    Here is a patch which fixes this issue.

    @serhiy-storchaka serhiy-storchaka self-assigned this May 27, 2014
    @serhiy-storchaka serhiy-storchaka changed the title socket.AddressFamily is absent in html pydoc socket.AddressFamily is absent in pydoc output May 27, 2014
    @vstinner
    Copy link
    Member

    I suggested to not document new enums of the socket module (ex: AddressFamily, SocketType) when they were added. I don't think that they should be part of Python public API.

    @serhiy-storchaka
    Copy link
    Member Author

    We should discuss this suggestion on Python-Dev. It affects the use of enums in other modules.

    @ethanfurman
    Copy link
    Member

    As I said in msg209237:
    ------------------------------------------------------------------------------------

    The containers are there to help with discoverability. If you want to know what
    all the (common) AF values are you can either do

    [name for name in dir(socket) if name.isupper() and name.startswith('AF_')]
    

    or

    list(socket.AddressFamily)
    

    ------------------------------------------------------------------------------------

    The Enum classes have been documented, so they should be in __all__.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 18, 2014

    New changeset f8a8ddf0b070 by Ethan Furman in branch '3.4':
    bpo-20689: add missing API pieces to __all__
    https://hg.python.org/cpython/rev/f8a8ddf0b070

    New changeset 7266562c2bb3 by Ethan Furman in branch 'default':
    bpo-20689: add missing API pieces to __all__
    https://hg.python.org/cpython/rev/7266562c2bb3

    @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
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants