◐ Shell
reader mode source ↗
Skip to content

bpo-38066: Hide internal Stream methods#15762

Merged
miss-islington merged 4 commits into
python:masterfrom
asvetlov:hide-private-streams-api
Sep 10, 2019
Merged

bpo-38066: Hide internal Stream methods#15762
miss-islington merged 4 commits into
python:masterfrom
asvetlov:hide-private-streams-api

Conversation

@asvetlov

@asvetlov asvetlov commented Sep 9, 2019

Copy link
Copy Markdown
Contributor

feed_eof(), feed_data(), set_exception(), and set_transport() are prefixed with underscore now.

https://bugs.python.org/issue38066

Automerge-Triggered-By: @asvetlov

@1st1

1st1 commented Sep 9, 2019

Copy link
Copy Markdown
Member

@asvetlov Andrew, can we also remove the Stream.transport property?

@asvetlov

asvetlov commented Sep 9, 2019

Copy link
Copy Markdown
Contributor Author

I think we can but it makes subprocess API a little less backward compatible.
Really wonder how much code is broken.
I'm working on backward-compatible approach: keep all mentioned method plus transport with underscore-prefixed version for internal usage and public version for backward compatibility that raises DeprecationWarding. It is the safest approach that we can do.

@1st1

1st1 commented Sep 9, 2019

Copy link
Copy Markdown
Member

But asyncio.Stream is a new thing - what backward compatibility problems do we have with it?

@asvetlov

asvetlov commented Sep 9, 2019

Copy link
Copy Markdown
Contributor Author

create_subprocess_exec / create_subprocess_exec used to work with StreamReader/StreamWriter, now they use asyncio.Stream. The replacement is drop-in, Stream has all API methods from reader and writer.

@1st1

1st1 commented Sep 9, 2019

Copy link
Copy Markdown
Member

Ah, right! Then your approach with deprecating them gracefully works. Don't forget to also update the docs.

@asvetlov

asvetlov commented Sep 9, 2019

Copy link
Copy Markdown
Contributor Author

Legacy methods are restored with emitting deprecation warnings.

@aeros aeros left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide comment

Thanks for the PR @asvetlov.

I have a couple of minor grammar suggestions.

@1st1

1st1 commented Sep 10, 2019

Copy link
Copy Markdown
Member

Great!

@miss-islington miss-islington merged commit 12c122a into python:master Sep 10, 2019
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @asvetlov for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 10, 2019
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>
@bedevere-bot

Copy link
Copy Markdown

GH-15847 is a backport of this pull request to the 3.8 branch.

@asvetlov asvetlov deleted the hide-private-streams-api branch September 10, 2019 12:56
miss-islington added a commit that referenced this pull request Sep 10, 2019
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>
websurfer5 pushed a commit to websurfer5/cpython that referenced this pull request Jul 20, 2020
feed_eof(), feed_data(), set_exception(), and set_transport() are prefixed with underscore now.


https://bugs.python.org/issue38066
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants