[PR #13295/29303217 backport][3.15] Fix documented default for StreamReader.read_nowait - #13528
Conversation
(cherry picked from commit 2930321)
Confidence Score: 5/5The documentation-only correction appears safe to merge. The updated signature matches both stream-reader implementations and resolves the previous contradiction with the parameter description; no blocking or non-blocking issue remains. Reviews (1): Last reviewed commit: "Fix documented default for StreamReader...." | Re-trigger Greptile |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 3.15 #13528 +/- ##
=======================================
Coverage 96.25% 96.25%
=======================================
Files 161 161
Lines 51411 51411
Branches 2798 2798
=======================================
+ Hits 49486 49487 +1
Misses 1748 1748
+ Partials 177 176 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Merging this PR will degrade performance by 10.62%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| 👁 | test_read_base64_part[pyloop] |
15.2 ms | 17 ms | -10.62% |
Comparing patchback/backports/3.15/29303217e0dc5f0bc469833ebed8475c04bf1093/pr-13295 (269efb7) with 3.15 (9e0b53c)
Footnotes
-
86 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
This is a backport of PR #13295 as merged into master (2930321).
What do these changes do?
Correct the documented signature of
StreamReader.read_nowaitindocs/streams.rst.The reference documented it as
read_nowait(n=None), but the real signature inaiohttp/streams.pyisdef read_nowait(self, n: int = -1). The code even carries a comment recording the change:The documentation was never updated to follow. Notably the
:param int n:description directly below the signature is already correct — it says "-1for the whole internal buffer" — so the signature line was the only stale part, and it contradicted the prose sitting three lines under it.One line changed. Documentation only, no code changes.
Are there changes in behavior for the user?
No. Nothing in the library changes. The reference now shows the default the method actually has, and no longer contradicts its own parameter description.
Is it a substantial burden for the maintainers to support this?
No. One-line documentation correction with no ongoing maintenance cost.
Related issue number
None — found while comparing documented parameter defaults against the real signatures.
Checklist
CONTRIBUTORS.txtCHANGES/folderDrafted with Claude Opus 5; reviewed by @LALITH0110.