Skip to content

docs: add missing docstrings for public API#3404

Open
nightcityblade wants to merge 1 commit intopython-trio:mainfrom
nightcityblade:fix/issue-3221-add-docstrings
Open

docs: add missing docstrings for public API#3404
nightcityblade wants to merge 1 commit intopython-trio:mainfrom
nightcityblade:fix/issue-3221-add-docstrings

Conversation

@nightcityblade
Copy link

Fixes #3221

Adds docstrings to the following public API items that were showing up without documentation:

  • MemorySendChannel — class docstring referencing open_memory_channel
  • MemoryReceiveChannel — class docstring referencing open_memory_channel
  • MemoryChannelStatistics — class docstring with attribute descriptions
  • SocketStream.send_all, wait_send_all_might_not_block, send_eof, receive_some, aclose — short docstrings referencing the parent ABC methods
  • HasFileno.fileno — method docstring
  • ParkingLot.broken_by — attribute docstring

The SocketStream method docstrings use See :meth:... cross-references rather than duplicating the ABC documentation, keeping them in sync with the parent class.

Tests run: pytest src/trio/_tests/test_channel.py src/trio/_tests/test_highlevel_socket.py src/trio/_core/_tests/test_parking_lot.py — all pass.

Add docstrings to:
- MemorySendChannel class
- MemoryReceiveChannel class
- MemoryChannelStatistics class and attributes
- SocketStream.send_all, wait_send_all_might_not_block, send_eof, receive_some, aclose
- HasFileno.fileno
- ParkingLot.broken_by attribute

Fixes python-trio#3221
@jakkdl
Copy link
Member

jakkdl commented Mar 5, 2026

See discussion in #3388

@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00000%. Comparing base (3dd35d7) to head (3da0288).

Additional details and impacted files
@@               Coverage Diff               @@
##                 main        #3404   +/-   ##
===============================================
  Coverage   100.00000%   100.00000%           
===============================================
  Files             128          128           
  Lines           19424        19425    +1     
  Branches         1318         1318           
===============================================
+ Hits            19424        19425    +1     
Files with missing lines Coverage Δ
src/trio/_channel.py 100.00000% <ø> (ø)
src/trio/_core/_parking_lot.py 100.00000% <100.00000%> (ø)
src/trio/_highlevel_socket.py 100.00000% <ø> (ø)
src/trio/_subprocess.py 100.00000% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Some functions and properties in the documentation have no docstring

2 participants