-
-
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
Add stubs for zstd
#9484
Add stubs for zstd
#9484
Conversation
stubs/zstd/zstd.pyi
Outdated
@@ -0,0 +1,13 @@ | |||
class Error(Exception): ... | |||
|
|||
def ZSTD_compress(data: str | bytes, level: int | None, threads: int | None) -> str | bytes: ... |
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.
If I remember my C argument codes correctly, the first arg should be _typeshed.ReadableBuffer
(https://github.com/sergey-dryabzhinsky/python-zstd/blob/master/src/python-zstd.c#L68 - I think y# is buffers). Also, the return type appears to be always bytes
.
(We don't care about Python 2 in typeshed.)
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.
I just tested and you seem to be right, I change it
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! I haven't looked at the other functions but I suspect the same things apply elsewhere. A few functions appear to be aliases for this one.
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.
Yep there are a lot of aliases, namely
- ZSTD_compress
- compress
- dumps
- ZSTD_uncompress
- decompress
- uncompress
- loads
- ZSTD_version
- version
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Jelle Zijlstra <[email protected]>
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Based on
zstd
's documentationCloses #9483