Skip to content

docs: drop undocumented SocketStream method stubs from the API ref#3439

Closed
mokashang wants to merge 1 commit into
python-trio:mainfrom
mokashang:docs/socketstream-docstrings
Closed

docs: drop undocumented SocketStream method stubs from the API ref#3439
mokashang wants to merge 1 commit into
python-trio:mainfrom
mokashang:docs/socketstream-docstrings

Conversation

@mokashang
Copy link
Copy Markdown

@mokashang mokashang commented May 12, 2026

Per A5rocks's review, this now removes :undoc-members: from the SocketStream autoclass directive instead of adding docstrings. The five overrides (send_all, wait_send_all_might_not_block, send_eof, receive_some, aclose) no longer show up as empty rows in the API table; users follow the inheritance link to the trio.abc contracts.

Two extras that fell out of doing it that way: the cross-reference further down in reference-io.rst pointed at trio.SocketStream.send_all, which no longer has a target, so it now points at trio.abc.SendStream.send_all; and the five matching entries in UNDOCUMENTED in conf.py were silencing warnings for things that aren't autodoc'd anymore, so I removed them too.

make html runs clean with -W. Refs #3221.

Comment thread src/trio/_highlevel_socket.py Outdated
trio.ClosedResourceError: if :meth:`send_eof` has already been called
on this stream, or if the underlying socket has been closed.

"""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No, this shouldn't be necessary! Try removing :undoc-members:.

@A5rocks
Copy link
Copy Markdown
Contributor

A5rocks commented May 13, 2026

FYI I have no patience for LLM-generated PR descriptions. Please either write your responses yourself, or I'll close this PR.

These five overrides on SocketStream had no docstring of their own, so they appeared in the SocketStream autodoc table as bare entries because of `:undoc-members:`. Remove that directive so the autoclass directive only lists members that actually have content (`setsockopt`, `getsockopt`, the `socket` attribute). Users following the inheritance chain still get the canonical contracts on the trio.abc classes.

Update the cross-reference in the socket section to point at `trio.abc.SendStream.send_all` since `trio.SocketStream.send_all` no longer has a documented target, and prune the now-dead entries from `UNDOCUMENTED` in conf.py.

Refs python-trio#3221.
@mokashang mokashang force-pushed the docs/socketstream-docstrings branch from 755eb46 to becb825 Compare May 13, 2026 02:07
@mokashang mokashang changed the title docs: add missing docstrings to SocketStream methods docs: drop undocumented SocketStream method stubs from the API ref May 13, 2026
@mokashang
Copy link
Copy Markdown
Author

Switched to that approach — pushed a new commit that drops :undoc-members: from the SocketStream autoclass directive. Two extras came along with it: the cross-reference at reference-io.rst:434 pointed at trio.SocketStream.send_all which no longer has a target, so it now goes to trio.abc.SendStream.send_all; and the five SocketStream entries in UNDOCUMENTED in conf.py were unreachable after the change, so I pulled them out. make html builds clean with -W.

On the previous description — fair point, I'll keep these terser.

@A5rocks A5rocks closed this May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants