bpo-36889: Document Stream class and add docstrings#14488
Conversation
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Sorry, something went wrong.
…hod and a coroutine.
|
I have pushed the changes to make sure
|
Sorry, something went wrong.
The interesting part is that multiple sync writes and single drain after doesn't help with buffering. Instead, it may consume more memory then expected. asyncio streams already have low and high watermarks for write buffer size control. If kernel write buffer is full the data is collected in asyncio internal write buffer. If the internal buffer size is greater than high watermark the writing is paused until the size of the buffer doesn't fall to less than the low watermark. After that write is resumed and keeps resumed until the high watermark is reached again. So, data is effectively buffered even if I doubt if we need to document it here, in a method reference. Maybe a separate asyncio section about buffering makes sense? |
Sorry, something went wrong.
|
Andrew, reading all of this makes me think about soft-deprecating non-await |
Sorry, something went wrong.
@1st1 I told you at US PyCon that non-awaitable methods are useless and should be deprecated eventually. You had doubts, so we decided to support both. I totally agree with the deprecation strategy. Does soft-deprecation means @1st1 what do you prefer? |
Sorry, something went wrong.
I'd do it in a very soft way in 3.8/3.9; basically we just warn users that they are deprecated in the docs and that's it. |
Sorry, something went wrong.
|
Ok, I agree with any decision. Sorry for the endless list of notes. Writing a new stream API took me weeks, documenting it takes a long as well. |
Sorry, something went wrong.
|
Added deprecated notes to No problem, I got to know better about the API while documentation and also closed some old and outdated issues related to Streams on the tracker with the PR. Appreciate your help on word formation and care to perfect user facing documentation. |
Sorry, something went wrong.
asvetlov
left a comment
There was a problem hiding this comment.
I like the current text, looks good.
The last nitpick: please provide an order to Stream methods.
I think alphabetical sorting is better than the current grouping.
Sorry, something went wrong.
|
Good, done. The current order is alphabetic sort as below with attribute mode at first |
Sorry, something went wrong.
asvetlov
left a comment
There was a problem hiding this comment.
Well done!
Thank you very much!
Sorry, something went wrong.
|
@1st1 please review again. The PR is ready for merging from my perspective |
Sorry, something went wrong.
|
Thanks @tirkarthi for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
Sorry, something went wrong.
|
I'm having trouble backporting to |
Sorry, something went wrong.
|
Thank you very much Andrew and Yury. I can create a separate PR if there are additional improvements. |
Sorry, something went wrong.
|
Oops. Sorry, @1st1 Anyway, please feel free to express your objection if any, @tirkarthi and I can fix them in the following PR quickly. |
Sorry, something went wrong.
|
Thanks @tirkarthi for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
Sorry, something went wrong.
* This just copies the docs from `StreamWriter` and `StreamReader`. * Add docstring for asyncio functions. https://bugs.python.org/issue36889 Automerge-Triggered-By: @asvetlov (cherry picked from commit d31b315) Co-authored-by: Xtreak <tir.karthi@gmail.com>
StreamWriterandStreamReader.https://bugs.python.org/issue36889
Automerge-Triggered-By: @asvetlov