bpo-38066: Hide internal Stream methods#15762
Conversation
|
@asvetlov Andrew, can we also remove the |
|
I think we can but it makes subprocess API a little less backward compatible. |
|
But |
|
|
|
Ah, right! Then your approach with deprecating them gracefully works. Don't forget to also update the docs. |
|
Legacy methods are restored with emitting deprecation warnings. |
|
|
||
| @property | ||
| def transport(self): | ||
| warnings.warn("Stream.transport attribute is deprecated " |
There was a problem hiding this comment.
asyncio itself never uses this property, there is no need for readonly internal API version
| # The helper tries to use fast-path to return already existing | ||
| # complete future object if underlying transport is not paused | ||
| #and actual waiting for writing resume is not needed | ||
| # and actual waiting for writing resume is not needed |
There was a problem hiding this comment.
I think it's ok to fix this unrelated comment spacing here. Don't worth a separate PR
| @@ -1366,7 +1371,7 @@ def writelines(self, data): | |||
| def _fast_drain(self): | |||
| # The helper tries to use fast-path to return already existing | |||
| # complete future object if underlying transport is not paused | |||
There was a problem hiding this comment.
Unrelated to the PR, but could make a minor grammar fix here? I could make further suggestions to the phrasing of the code comments for this method, but I figured this suggestion would be easier and uncontroversial.
| # complete future object if underlying transport is not paused | |
| # complete future object if the underlying transport is not paused |
There was a problem hiding this comment.
fast drain works with the single object, not multiple ones.
There was a problem hiding this comment.
fast drain works with the single object, not multiple ones.
Oops, I'll adjust the suggestion.
|
Great! |
|
Thanks @asvetlov for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
feed_eof(), feed_data(), set_exception(), and set_transport() are prefixed with underscore now. https://bugs.python.org/issue38066 (cherry picked from commit 12c122a) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
|
GH-15847 is a backport of this pull request to the 3.8 branch. |
feed_eof(), feed_data(), set_exception(), and set_transport() are prefixed with underscore now. https://bugs.python.org/issue38066 (cherry picked from commit 12c122a) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
feed_eof(), feed_data(), set_exception(), and set_transport() are prefixed with underscore now. https://bugs.python.org/issue38066
feed_eof(), feed_data(), set_exception(), and set_transport() are prefixed with underscore now.
https://bugs.python.org/issue38066
Automerge-Triggered-By: @asvetlov