Skip to content
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

Open
Sophon96 opened this issue Sep 10, 2024 · 2 comments
Open

Add type hints #173

Sophon96 opened this issue Sep 10, 2024 · 2 comments

Comments

@Sophon96
Copy link

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

@milesgranger
Copy link
Owner

milesgranger commented Sep 11, 2024

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 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.


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.

@Sophon96
Copy link
Author

Sophon96 commented Sep 11, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants