You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HTTPResponse is not recognized as a subtype of typing.IO #2189
This fails with Argument 1 to "copyfileobj" has incompatible type "Union[HTTPResponse, BinaryIO]"; expected IO[Any] because HTTPResponse derives from io.BufferedIOBase, which (despite being a binary IO) does not derive from typing.BinaryIO (nor does io.RawIOBase; also io.IOBase does not derive from typing.IO).
When I attempted to derive them as I thought would make sense, I got errors because __enter__ and other methods are defined both in io.IOBase and in typing.BinaryIO.
Activity
asottile commentedon Jun 4, 2018
From @ethanhs
make http.client.HTTPResponse be a BinaryIO
Make http.client.HTTPResponse a BinaryIO (#2218)
Make http.client.HTTPResponse a BinaryIO (python#2218)