8000 Sync typeshed by AlexWaygood · Pull Request #14902 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

Sync typeshed #14902

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 6 commits into from
Mar 15, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading 8000
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix tests
  • Loading branch information
AlexWaygood committed Mar 15, 2023
commit 1ab6232356c2292e7c0793b97aa590516c9e23d8
4 changes: 3 additions & 1 deletion test-data/unit/pythoneval.test
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@ def bin(f: IO[bytes]) -> None:
txt(sys.stdout)
bin(sys.stdout)
[out]
_program.py:5: error: Argument 1 to "write" of "IO" has incompatible type "bytes"; expected "str"
_program.py:5: error: No overload variant of "write" of "IO" matches argument type "bytes"
_program.py:5: note: Possible overload variants:
_program.py:5: note: def write(self, str, /) -> int
Comment on lines -271 to +273
Copy link
Member Author
@AlexWaygood AlexWaygood Mar 15, 2023

Choose a reason for hiding this comment

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

The change in error message here is slightly unfortunate; the previous error message was better. It's due to a combination of python/typeshed#9861, which made IO.write an overloaded method, and #14882, which means that mypy now correctly deduces that only one overload applies in this specific situation.

_program.py:10: error: Argument 1 to "bin" has incompatible type "TextIO"; expected "IO[bytes]"

[case testBuiltinOpen]
Expand Down
0