This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: socket.AddressFamily is absent in pydoc output
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: ethan.furman, python-dev, serhiy.storchaka, vajrasky, vstinner
Priority: normal Keywords: patch

Created on 2014-02-19 21:43 by serhiy.storchaka, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
socket.AddressFamily.html berker.peksag, 2014-05-24 08:49
socket.SocketType.html berker.peksag, 2014-05-24 08:49
socket.html serhiy.storchaka, 2014-05-24 10:05
pydoc_display_AddressFamily.patch vajrasky, 2014-05-27 13:04 review
socket__all__.patch serhiy.storchaka, 2014-05-27 14:51 review
Messages (10)
msg211662 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-02-19 21:43
The documentation for socket.AddressFamily (unlike to SocketType) isn't generated in html page by pydoc.

May be issue20654 is similar to this issue.
msg219029 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2014-05-24 08:49
I couldn't reproduce this issue. I'm attaching HTML output of both socket.AddressFamily and socket.SocketType enum types.
msg219030 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-05-24 10:05
Try "./python -m pydoc -w socket".
msg219218 - (view) Author: Vajrasky Kok (vajrasky) * Date: 2014-05-27 13:04
I found the culprit. The AddressFamily is not registered in _socket module. I created a preliminary patch to show the culprit.
msg219226 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-05-27 14:05
"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.
msg219227 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-05-27 14:51
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 issue20386).

Here is a patch which fixes this issue.
msg219228 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-05-27 14:57
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.
msg219291 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-05-28 16:24
We should discuss this suggestion on Python-Dev. It affects the use of enums in other modules.
msg229632 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2014-10-18 05:54
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__.
msg229663 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-10-18 22:11
New changeset f8a8ddf0b070 by Ethan Furman in branch '3.4':
Issue20689: add missing API pieces to __all__
https://hg.python.org/cpython/rev/f8a8ddf0b070

New changeset 7266562c2bb3 by Ethan Furman in branch 'default':
Issue20689: add missing API pieces to __all__
https://hg.python.org/cpython/rev/7266562c2bb3
History
Date User Action Args
2022-04-11 14:57:58adminsetgithub: 64888
2014-10-18 22:13:16ethan.furmansetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2014-10-18 22:11:23python-devsetnosy: + python-dev
messages: + msg229663
2014-10-18 05:54:46ethan.furmansetnosy: + ethan.furman
messages: + msg229632
2014-05-28 16:24:48serhiy.storchakasetmessages: + msg219291
2014-05-27 14:57:21vstinnersetmessages: + msg219228
2014-05-27 14:51:52serhiy.storchakasettitle: socket.AddressFamily is absent in html pydoc -> socket.AddressFamily is absent in pydoc output
2014-05-27 14:51:19serhiy.storchakasetfiles: + socket__all__.patch
versions: + Python 3.5
messages: + msg219227

assignee: serhiy.storchaka
stage: patch review
2014-05-27 14:05:30vstinnersetnosy: + vstinner
messages: + msg219226
2014-05-27 13:21:00berker.peksagsetnosy: - berker.peksag
2014-05-27 13:04:30vajraskysetfiles: + pydoc_display_AddressFamily.patch

nosy: + vajrasky
messages: + msg219218

keywords: + patch
2014-05-24 10:06:02serhiy.storchakasetfiles: + socket.html

messages: + msg219030
2014-05-24 08:49:48berker.peksagsetfiles: + socket.SocketType.html
2014-05-24 08:49:30berker.peksagsetfiles: + socket.AddressFamily.html
nosy: + berker.peksag
messages: + msg219029

2014-02-19 21:43:51serhiy.storchakacreate