TYP: Add annotations for the py3.12 buffer protocol#24705
TYP: Add annotations for the py3.12 buffer protocol#24705charris merged 3 commits intonumpy:mainfrom
Conversation
|
@BvB93 I have an unrelated question. I assume the difference is harmless. Is it? |
Correct, it's harmless. I would recommend leaving |
|
The test failures look unrelated. The macos_arm64_test crash is new. Hmm ... Will rerun. |
|
Thanks Bas. @seiko2plus Any chance the aarch64 fixes could have accounted for the macos_arm64_test crash? I'm sorry that I reran the test, but wanted to see if it was repeatable. |
I ran tests on clang 14 & 15, both were fine. If the partial load refactor (gh-24461) is the issue, then it should be consistent. |
With the implementation of PEP 688 the buffer protocol is, as of Python 3.12, now accessible in Python. This PR updates the
np.ndarrayandnp.genericannotations, adding the corresponding__buffer__method to the both of them in addition to the definition ofnpt.ArrayLike.Marking as 1.26 backport as this is a reasonably py3.12 typing feature.