-
-
Notifications
You must be signed in to change notification settings - Fork 7
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 type hints #173
Comments
Interesting, which parts do you think would be most helpful to add type hints for?
Could be nice, but I think it's low priority for me at the moment; mostly because it's completely decoupled from existing Rust code which isn't appealing and seems PyO3 is on the way to provide automated typing anyhow https://pyo3.rs/v0.22.2/python-typing-hints.html. Would entertain a PR though if you're eager for it. Edit: in reflection, it does have a decent amount of types when accounting for different input types for other algorithms like blosc2, xz and maybe some others. |
Thanks for the reply. It would be nice to have stub files for the modules
and functions, as that would enable intellisense and linters to function.
I do agree with your reasoning about this issue being low-priority. It’s
definitely awkward that the stubs are decoupled from the rust code, but it
looks like PyO3 is a while away from finishing the automated type
inspections (might be wrong, only took a quick glance at the issue thread).
I’ve got a PR in-progress; I’ll send it over when it's done.
…On Wed, Sep 11, 2024 at 4:43 AM Miles Granger ***@***.***> wrote:
Interesting, which parts do you think would be most helpful to add type
hints for?
The project doesn't have many different types, and inputs are basically
two native cramjam objects (cramjam.File, cramjam.Buffer), and then what I
guess would be Buffer
<https://docs.python.org/3.12/library/collections.abc.html#collections.abc.Buffer>
type. (anything implementing the buffer protocol).
Could be nice, but I think it's low priority for me at the moment; mostly
because it's completely decoupled from existing Rust code which isn't
appealing and seems PyO3 is on the way to provide automated typing anyhow
https://pyo3.rs/v0.22.2/python-typing-hints.html.
Would entertain a PR though if you're eager for it.
—
Reply to this email directly, view it on GitHub
<#173 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARC5EIHT6FXFPD2ZRODWNWDZWAUGDAVCNFSM6AAAAABN5ZQ7XGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBTGQZTQOJUGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hello,
This library has been really useful for me, but I believe the developer experience would be greatly enhanced with the addition of type hints. The addition of type hints would allow IDEs to show intellisense completions, and other tooling, like linters or type checkers to do their job. It currently appears that the only way to define type hints with rust/Python ffi is to add type stubs to the wheel during build process.
Best,
Brandon
The text was updated successfully, but these errors were encountered: