TYP,ENH: Mark numpy.typing protocols as runtime checkable#22357
TYP,ENH: Mark numpy.typing protocols as runtime checkable#22357charris merged 1 commit intonumpy:mainfrom
numpy.typing protocols as runtime checkable#22357Conversation
|
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.ArrayLikeandnpt.DTypeLikewere 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.