We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
mypy test.py test.py:10: error: Argument 1 to "test" has incompatible type "BinaryIO"; expected "BufferedIOBase"
cat test.py
import io import sys class C(io.BufferedIOBase): pass def test(c: io.BufferedIOBase): assert isinstance(c, io.BufferedIOBase) test(sys.stdout.buffer) test(C())
python3 test.py
As we can see the isinstance check passes but mypy asserts
The text was updated successfully, but these errors were encountered:
This is currently hard to fix and depends on typeshed using protocols for file argument types. See python/typing#564 for more information.
Sorry, something went wrong.
No branches or pull requests
As we can see the isinstance check passes but mypy asserts
The text was updated successfully, but these errors were encountered: