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

Use NumPy's SupportsDType #7479

Closed
jhamman opened this issue Jan 26, 2023 · 0 comments · Fixed by #7521
Closed

Use NumPy's SupportsDType #7479

jhamman opened this issue Jan 26, 2023 · 0 comments · Fixed by #7521

Comments

@jhamman
Copy link
Member

jhamman commented Jan 26, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant