-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
bpo-38066: Hide internal Stream methods #15762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's ok to fix this unrelated comment spacing here. Don't worth a separate PR
aeros
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @asvetlov.
I have a couple of minor grammar suggestions.
|
|
||
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast drain works with the single object, not multiple ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
|
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 <[email protected]>
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