Skip to content

Conversation

@christopher-hesse
Copy link
Contributor

It's not clear to me what the relation between BufferedIOBase and IO[bytes] is, but according to the io docs the current code seems incorrect.

@christopher-hesse
Copy link
Contributor Author

The fact that the tests fail makes me think this is not correct. I'm not certain why that is though.

@christopher-hesse
Copy link
Contributor Author

Guess this should be two PRs.

@srittau srittau added the status: deferred Issue or PR deferred until some precondition is fixed label Dec 3, 2019
@srittau
Copy link
Collaborator

srittau commented Dec 3, 2019

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.

@christopher-hesse
Copy link
Contributor Author

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.

@srittau srittau added the topic: io I/O related issues label May 28, 2020
@JelleZijlstra
Copy link
Member

Superseded by #4145

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: deferred Issue or PR deferred until some precondition is fixed topic: io I/O related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants