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

Type hints in Codec class #443

Open
Alexey-Kamenev opened this issue Jun 29, 2023 · 3 comments
Open

Type hints in Codec class #443

Alexey-Kamenev opened this issue Jun 29, 2023 · 3 comments

Comments

@Alexey-Kamenev
Copy link

I've noticed that Codec class methods, such as encode and decode, do not use type hints. Is this intentional or something that can be added in the future?

@martindurant
Copy link
Member

It is not intentional - this code mostly predates type-hinting as normal practice in python. If you made a PR to add, it would probably be accepted, assuming you can find good definitions for "buffer-like" and similar.

@madsbk
Copy link
Contributor

madsbk commented Jun 30, 2023

I think it would be very valuable if numcodecs implements a protocol type for buffer-like similar to what we have for array-likes that we can use throughout the Zarr ecosystem.

@jakirkham
Copy link
Member

In terms of typing Buffer, this is getting better. Please see PEP 688

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

4 participants