-
Notifications
You must be signed in to change notification settings - Fork 189
type annotations for cloudpickle #590
Description
Is there interest in adding support for static typing to cloudpickle? Because if so, I'd be willing to work on that :)
To be a bit more specific, I'm talking about fully annotating the cloudpickle codebase, validate that using a static type-checker in CI, and add a py.typed (PEP 561).
The annotations could be either provided as inline annotations (which will help runtime type-checkers such as beartype), or as non-intrusive .pyi stubs that live next to the .py sources. The latter would make things a bit more complicated on the CI side of things, because we'll then have to validate that the stubs match the runtime definitions using a tool like mypy's stubtest. Generally speaking, inline annotations are preferred. And I think that in case of cloudpickle that'd indeed be the best choice. But if you want to go with .pyi stubs instead, then that's also fine as far as I'm concerned.