docs: add docstrings to memory channel classes#3406
Open
wavebyrd wants to merge 2 commits intopython-trio:mainfrom
Open
docs: add docstrings to memory channel classes#3406wavebyrd wants to merge 2 commits intopython-trio:mainfrom
wavebyrd wants to merge 2 commits intopython-trio:mainfrom
Conversation
Add docstrings to MemoryChannelStatistics, MemorySendChannel, and MemoryReceiveChannel classes so they show up properly in the Sphinx-generated documentation. - MemoryChannelStatistics: Document all attributes with descriptions - MemorySendChannel: Reference open_memory_channel and note it implements SendChannel interface - MemoryReceiveChannel: Reference open_memory_channel and note it implements ReceiveChannel interface Partial fix for python-trio#3221 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Author
|
Hi! Just checking in on this documentation PR. Happy to address any feedback. |
A5rocks
approved these changes
Mar 16, 2026
src/trio/_channel.py
Outdated
| returns a pair of (:class:`MemorySendChannel`, :class:`MemoryReceiveChannel`). | ||
| See :func:`open_memory_channel` for full documentation. | ||
|
|
||
| This implements the :class:`~trio.abc.ReceiveChannel` interface. |
Contributor
There was a problem hiding this comment.
Huh I don't think this is necessary. Do we do this elsewhere?
src/trio/_channel.py
Outdated
| """Statistics about a memory channel. | ||
|
|
||
| This object is returned by the ``statistics()`` method on | ||
| :class:`MemorySendChannel` and :class:`MemoryReceiveChannel`. |
Contributor
There was a problem hiding this comment.
IMO not necessary to have a backref like this here.
Address review feedback: - Remove backref in MemoryChannelStatistics docstring - Remove "implements interface" lines from Send/ReceiveChannel Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Author
|
Thanks for the review! I've addressed both nitpicks - removed the backref in MemoryChannelStatistics and the 'implements interface' lines from both channel classes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add docstrings to memory channel classes so they show up properly in the Sphinx-generated documentation:
MemoryChannelStatistics: Added docstring documenting all six attributesMemorySendChannel: Added docstring referencingopen_memory_channeland noting it implementsSendChannelinterfaceMemoryReceiveChannel: Added docstring referencingopen_memory_channeland noting it implementsReceiveChannelinterfacePartial fix for #3221 (addresses 3 of the 11 items)
Test plan
🤖 Generated with Claude Code