Skip to content

Fix stab for TextIOBase.detach() and add stab for TextIOWrapper.buffer #4036

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

Merged
merged 2 commits into from
May 19, 2020

Conversation

serhiy-storchaka
Copy link
Member

Closes #3993.

@@ -164,13 +164,15 @@ class TextIOWrapper(TextIO):
# -> None: ...
def __init__(
self,
buffer: IO[bytes],
buffer: BinaryIO,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe CI fails due to this change. Honestly, I would just leave this instance as IO[bytes] for now. In the future it might make sense to make TextIOWrapper generic over the buffer, but I haven't looked at it in depth.

@hauntsaninja
Copy link
Collaborator

As it happens, I just removed that particular sample from mypy (python/mypy#8838), so if you re-run CI it should pass.

@srittau
Copy link
Collaborator

srittau commented May 18, 2020

I'm re-running it. It would be great if someone with a large typed code base (hey Dropbox team) could check this, though. Our internal code base doesn't use TextIOWrapper directly.

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

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

Ok, let's try this out. If it breaks anything, we can always partly revert before the next mypy release.

@srittau srittau merged commit 9902348 into python:master May 19, 2020
vishalkuo pushed a commit to vishalkuo/typeshed that referenced this pull request Jun 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The result of TextIOWrapper.detach() should be IO[bytes]
3 participants