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
HTTPResponse is not recognized as a subtype of typing.IO #2189
Comments
From @ethanhs
|
This was referenced Jun 4, 2018
Remove loads(...read()) workaround once newer mypy is released
pre-commit/pre-commit-mirror-maker#39
Closed
JelleZijlstra
added a commit
to JelleZijlstra/typeshed
that referenced
this issue
Jun 12, 2018
Fixes python#2189 The errors from mypy are a false positive (see python/mypy#5027).
gvanrossum
pushed a commit
that referenced
this issue
Jun 12, 2018
Fixes #2189. The errors from mypy are a false positive (see python/mypy#5027).
yedpodtrzitko
pushed a commit
to yedpodtrzitko/typeshed
that referenced
this issue
Jan 23, 2019
Fixes python#2189. The errors from mypy are a false positive (see python/mypy#5027).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Copied from python/mypy#3108
From SO:
This fails with
Argument 1 to "copyfileobj" has incompatible type "Union[HTTPResponse, BinaryIO]"; expected IO[Any]
becauseHTTPResponse
derives fromio.BufferedIOBase
, which (despite being a binary IO) does not derive fromtyping.BinaryIO
(nor doesio.RawIOBase
; alsoio.IOBase
does not derive fromtyping.IO
).When I attempted to derive them as I thought would make sense, I got errors because
__enter__
and other methods are defined both inio.IOBase
and intyping.BinaryIO
.Not sure how to solve it.
The text was updated successfully, but these errors were encountered: