
I am working to transition mkl_fft and mkl_random to NumPy 2.0. Both of these projects contain native extensions. I have distilled unexpected behavior behind observed test failures in minimal C extension: https://github.com/oleksandr-pavlyk/reproducer-for-question-about-numpy2 The extension defines a single Python function which does expects numpy.ndarray, and queries its itemsize in two ways 1. By calling C function declared in "_aux.h" defined in "_aux.c" to call PyArray_ITEMSIZE and return the result 2. By calling PyArray_ITEMSIZE directly https://github.com/oleksandr-pavlyk/reproducer-for-question-about-numpy2/blo... The result obtained by calling C function is always 0, while direct call gives the correct result. I am hoping for advice about what is wrong and how to fix it. Thank you, Sasha