Skip to content

docs: add missing docstrings to MemorySendChannel, MemoryReceiveChannel, MemoryChannelStatistics, SocketStream methods#3445

Closed
sridhar-3009 wants to merge 2 commits into
python-trio:mainfrom
sridhar-3009:docs/add-missing-docstrings
Closed

docs: add missing docstrings to MemorySendChannel, MemoryReceiveChannel, MemoryChannelStatistics, SocketStream methods#3445
sridhar-3009 wants to merge 2 commits into
python-trio:mainfrom
sridhar-3009:docs/add-missing-docstrings

Conversation

@sridhar-3009
Copy link
Copy Markdown

Summary

Contributes to #3221.

Adds docstrings to 8 items listed as missing in the issue:

Item File
MemoryChannelStatistics class _channel.py
MemorySendChannel class _channel.py
MemoryReceiveChannel class _channel.py
SocketStream.send_all _highlevel_socket.py
SocketStream.wait_send_all_might_not_block _highlevel_socket.py
SocketStream.send_eof _highlevel_socket.py
SocketStream.receive_some _highlevel_socket.py
SocketStream.aclose _highlevel_socket.py

The SocketStream methods use the standard one-liner See :meth:...`` pattern pointing to the ABC definition (same style used by other stream implementations in trio). The channel classes get descriptive class-level docstrings.

trio.lowlevel.ParkingLot.broken_by and trio._subprocess.HasFileno.fileno are left for a follow-up as they require reading private/subprocess internals.

…am methods

Several public classes and methods were missing docstrings, causing them
to show up as undocumented in the API reference.

- MemoryChannelStatistics: add class-level docstring with field descriptions
- MemorySendChannel: add class-level docstring
- MemoryReceiveChannel: add class-level docstring
- SocketStream.send_all: add one-line docstring referencing the ABC
- SocketStream.wait_send_all_might_not_block: add docstring
- SocketStream.send_eof: add docstring
- SocketStream.receive_some: add docstring
- SocketStream.aclose: add docstring

Contributes to python-trio#3221
Copy link
Copy Markdown
Contributor

@A5rocks A5rocks left a comment

Choose a reason for hiding this comment

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

Please fix CI! Btw if you respond with a LLM generated comment I'll close this PR.

return await self.socket.recv(max_bytes)

async def aclose(self) -> None:
"""See :meth:`trio.abc.AsyncResource.aclose`."""
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.

IIRC this is because of how we configured the autoclass. Can we do that instead?

@sridhar-3009
Copy link
Copy Markdown
Author

Please fix CI! Btw if you respond with a LLM generated comment I'll close this PR.

@A5rocks go ahead and close it 😃

@A5rocks A5rocks closed this May 30, 2026
@sridhar-3009 sridhar-3009 deleted the docs/add-missing-docstrings branch May 31, 2026 07:47
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