Skip to content

Use NumPy's SupportsDType #7479

Closed
Closed
@jhamman

Description

@jhamman

What is your issue?

Now that we've bumped our minimum NumPy version to 1.21, we can address this comment:

# once NumPy 1.21 is minimum version, use NumPys definition directly
# 1.20 uses a non-generic Protocol (like we define here for simplicity)
class _SupportsDType(Protocol):
@property
def dtype(self) -> np.dtype:
...

I decided not to tackle this as part of #7461 but we may be able to do something like this:

from numpy.typing._dtype_like import _DTypeLikeNested, _ShapeLike, _SupportsDType

xref: #6834
cc @headtr1ck

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions