Add KernelType
type annotation
#72
Labels
documentation
Improvements or additions to documentation
enhancement
New feature or request
help wanted
Extra attention is needed
[W]e could really use some type annotations for arguments like this. I honestly don't know the exact form of a valid
kernel
type (other than that it's a callable of some sort), so this is one instance where the type info really helps. In order to figure this out, I would have to trace where it's used in this codebase, and/or guess and check.A custom type (alias) that explicitly ties together the functions in this library that construct valid
kernel
arguments is really all that's necessary to answer basic questions, so there's no need to delve much deeper thanKernelType = Callable[[...], ...]
—although something likeKernelType = NewType("KernelType", Callable[[...], ...])
might be better for maintaining the "this function takes/outputs acceptable kernels" information when the local variable nameKernelType
isn't present in context (e.g. some Mypy reporting).Originally posted by @brandonwillard in #66 (comment)
The text was updated successfully, but these errors were encountered: