-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
TYP,ENH: Mark numpy.typing
protocols as runtime checkable
#22357
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
Conversation
Backport? |
I'd consider this more of an enhancement rather than a bug fix, but I wouldn't mind either way to be honest. I don't anticipate any merge conflicts when cherry picking in any case. |
Thanks Bas. |
This seems to have caused a problem with the conda test after merging. https://dev.azure.com/numpy/numpy/_build/results?buildId=26134&view=logs&j=aeae9a1e-382d-52a1-f0dc-4dfb59c9608d&t=52b2fe40-7265-5065-1a6d-137421ab3f90 . Looks like hypothesis is at fault, version 6.55.0 was released two days ago with a new |
@Zac-HD ping |
I think @honno is planning a patch to add this - I think it's meant to be a required attribute, but we might be running a bit ahead of the ecosystem here 😕. Unclear what the best medium-term solution would be (@honno?), but either adding that attribute or temporarily limiting the Hypothesis version should work. I'll also plan to turn that error into a warning+fallback-to-oldest-spec in Hypothesis. refs: HypothesisWorks/hypothesis#3456 (comment) and data-apis/array-api#480 |
Or, taking the advice from the error message, we could add
|
Oh dear 😅 IMO we might as well add |
numpy.typing
protocols as runtime checkablenumpy.typing
protocols as runtime checkable
Closes #22352
The protocols used in
npt.ArrayLike
andnpt.DTypeLike
were previously not marked as runtime checkable while they easily could have been (the lack therefor being more of an oversight). This PR addresses aforementioned issue.