Skip to content

Update io.pyi - #4912

Merged
srittau merged 5 commits into
python:masterfrom
baterflyrity:patch-1
Jan 8, 2021
Merged

Update io.pyi#4912
srittau merged 5 commits into
python:masterfrom
baterflyrity:patch-1

Conversation

@baterflyrity

Copy link
Copy Markdown
Contributor

See corresponding issue.

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

github-actions Bot commented Jan 6, 2021

Copy link
Copy Markdown
Contributor

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

Akuli commented Jan 6, 2021

Copy link
Copy Markdown
Collaborator

Maybe this is related: python/mypy#5876

@Akuli Akuli left a comment

Copy link
Copy Markdown
Collaborator

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.

Comment thread stdlib/3/io.pyi Outdated
Comment thread stdlib/3/io.pyi Outdated
@baterflyrity

Copy link
Copy Markdown
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

github-actions Bot commented Jan 6, 2021

Copy link
Copy Markdown
Contributor

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

Akuli commented Jan 6, 2021

Copy link
Copy Markdown
Collaborator

Don't know if mypy_primer is showing outdated results above

@baterflyrity

Copy link
Copy Markdown
Contributor Author

@Akuli , so what can you suggest?

@Akuli

Akuli commented Jan 6, 2021

Copy link
Copy Markdown
Collaborator

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

@baterflyrity

baterflyrity commented Jan 7, 2021

Copy link
Copy Markdown
Contributor Author

@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

Akuli commented Jan 7, 2021

Copy link
Copy Markdown
Collaborator

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.

@srittau srittau left a comment

Copy link
Copy Markdown
Collaborator

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