Skip to content

Update io.pyi #4912

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 5 commits into from
Jan 8, 2021
Merged

Update io.pyi #4912

merged 5 commits into from
Jan 8, 2021

Conversation

baterflyrity
Copy link
Contributor

See corresponding issue.

See corresponding [issue](#4906 (comment)).
@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2021

Diff from mypy_primer, showing the effect of this PR on open source code:

werkzeug (https://github.com/pallets/werkzeug.git)
+ src/werkzeug/wsgi.py:962: error: Signature of "read" incompatible with supertype "IOBase"

rich (https://github.com/willmcgugan/rich.git)
+ rich/file_proxy.py:28: error: Signature of "write" incompatible with supertype "IOBase"

pytest (https://github.com/pytest-dev/pytest.git)
+ src/_pytest/capture.py:208: error: Signature of "write" incompatible with supertype "IOBase"  [override]

@Akuli
Copy link
Collaborator

Akuli commented Jan 6, 2021

Maybe this is related: python/mypy#5876

Copy link
Collaborator

@Akuli Akuli left a comment

Choose a reason for hiding this comment

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

This should fix the mypy_primer errors. I tried doing what werkzeug does, but I didn't check if other errors get fixed with this.

@baterflyrity
Copy link
Contributor Author

@Akuli , thanks for help. Useful link and commit, hope it will help.

ps
Also one can try for similar issue next links: partially arbitrary parameters and property hack.

baterflyrity and others added 2 commits January 6, 2021 20:42
Co-authored-by: Akuli <akuviljanen17@gmail.com>
@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2021

Diff from mypy_primer, showing the effect of this PR on open source code:

rich (https://github.com/willmcgugan/rich.git)
+ rich/file_proxy.py:28: error: Signature of "write" incompatible with supertype "IOBase"

pytest (https://github.com/pytest-dev/pytest.git)
+ src/_pytest/capture.py:208: error: Signature of "write" incompatible with supertype "IOBase"  [override]

@Akuli
Copy link
Collaborator

Akuli commented Jan 6, 2021

Don't know if mypy_primer is showing outdated results above

@baterflyrity
Copy link
Contributor Author

@Akuli , so what can you suggest?

@Akuli
Copy link
Collaborator

Akuli commented Jan 6, 2021

I would try making an empty commit to rerun mypy_primer. Don't know if there's a better way.

@baterflyrity
Copy link
Contributor Author

baterflyrity commented Jan 7, 2021

@Akuli , very nice, according to mypy_primer no diffs have been found. So what is needed next to merge this PR and close #4906 ?

@Akuli
Copy link
Collaborator

Akuli commented Jan 7, 2021

A typeshed collaborator (not me, I'm just a contributor) has to review this, and if it looks good to the collaborator, they will likely merge it and close the issue.

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.

The change seems correct to me and the best solution. I am still a bit wary that this might cause unforeseen problems, but the mypy_primer output makes me optimistic. Let's try this an be prepared to revert if it causes problems.

@srittau srittau merged commit 1d9da4e into python:master Jan 8, 2021
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.

3 participants