-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
binhex: improve bytes handling #9035
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it calls len
. I'd say we should add a _BufferWithLen: TypeAlias = ReadableBuffer
to _typeshed
(or at least add a comment). This would have been useful in at least one other place
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
I agree with adding this, but why the leading underscore, out of interest? |
Oh, I don't remember exactly what rules we have for |
+1 |
Cool, that makes sense! |
Source: https://github.com/python/cpython/blob/85f88f63d96b07208c98a725391af7cb710fe06b/Lib/binhex.py#L216-L234
Both
write
andwrite_rsrc
callsio.open(..., 'wb').write(data)