Skip to content

NDArray[MyObject] type annotations are not allowed #1789

@mpharrigan

Description

@mpharrigan

mypy/numpy type checking keeps getting stricter about our abuse of the NDArray type annotation. We use numpy arrays of python objects and use NDArray[MyCustomObject] type annotations, which numpy doesn't like. It only wants its native datatypes as generic parameters, so these should be NDArray[np.object_] but then we lose the documentation benefits. I'm not sure the best way to proceed. As a workaround, we've been adding type: ignore comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    devopsInvolves build systems, Make files, Bazel files, continuous integration, and or other DevOps topics

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions