Conversation
|
The fact that the tests fail makes me think this is not correct. I'm not certain why that is though. |
|
Guess this should be two PRs. |
|
IO types are quite problematic in typeshed at the moment. Changes tend to break lots of code. The ultimate goal is to use protocols for parameter types and concrete types as return values. Attributes and other cases must be looked at on a case-by-case basis. But we are still a long way off from that goal. I've marked this PR as "deferred" for now. |
|
Thanks, I noticed the odd lack of protocols after trying to use type checking with io objects for a bit and ended up using some dumpy fake protocol: https://github.com/cshesse/blobfile/blob/master/blobfile/ops.py#L1065 and cast()ing return values to pretend to be the correct types. |
|
Superseded by #4145 |
It's not clear to me what the relation between
BufferedIOBaseandIO[bytes]is, but according to the io docs the current code seems incorrect.