| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import mmap | ||
| from typing import IO, AnyStr | ||
|
|
||
|
|
||
| def check_write(io_bytes: IO[bytes], io_str: IO[str], io_anystr: IO[AnyStr], any_str: AnyStr, buf: mmap.mmap) -> None: | ||
| io_bytes.write(b"") | ||
| io_bytes.write(buf) | ||
| io_bytes.write("") # type: ignore | ||
| io_bytes.write(any_str) # type: ignore | ||
|
|
||
| io_str.write(b"") # type: ignore | ||
| io_str.write(buf) # type: ignore | ||
| io_str.write("") | ||
| io_str.write(any_str) # type: ignore | ||
|
|
||
| io_anystr.write(b"") # type: ignore | ||
| io_anystr.write(buf) # type: ignore | ||
| io_anystr.write("") # type: ignore | ||
| io_anystr.write(any_str) |
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityIs the third overload needed? This should be covered by the preceding two overloads. (Same for further overloads below.)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityUnfortunately the test cases I've added don't pass for pyright unless we include this third overload. This is due to a design decision by pyright in the way it handles contrained TypeVars that leads to different behaviour from mypy: https://github.com/microsoft/pyright/blob/main/docs/mypy-comparison.md#constrained-type-variables
It's the same issue that led to microsoft/pyright#4534 being filed, which we then fixed over at typeshed in #9592.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.