Skip to content

fix types in io #3485

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

Closed
wants to merge 2 commits into from
Closed

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