-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
typing: Add peek method to BinaryIO (#3951) #3957
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
Conversation
I see that it's failing in CI, I'll try to find out why. EDIT: Fixed. |
Thank you for the PR. IO types are currently a bit of a mess. The long term plan is to have concrete classes returned from functions. Currently, The implementation of |
Ah, I see! Makes sense not to add this, then. Let me know how I can help with this! |
@JelleZijlstra a friendly ping |
I guess we can try returning custom types from |
Yes, something breaking is a real danger, we certainly need to test this change. |
Let's close this because |
Issue.
In the below example,
f
is of typeBinaryIO
and has methodpeek
(docs), but mypy doesn't know this.The
size
parameter topeek
is optional. Issize: int = ...
the correct way to indicate that? That's what I saw other places in the code base.