Conversation
|
Not a full review, will try to give this a read tomorrow.
Most likely a left over from the times before
Good question, not sure. I think I'd also prefer having the |
Icxolu
left a comment
There was a problem hiding this comment.
Thank you ❤️ I think this is a great start already. I left a few comments, mostly documentation related. We should also make sure to add a changelog entry for this.
|
|
||
| /// See [PY_ARRAY_API] for more. | ||
| pub struct PyArrayAPI(PyOnceLock<*const *const c_void>); | ||
| pub struct PyArrayAPI(PyOnceLock<NonNull<*const c_void>>); |
There was a problem hiding this comment.
Very nice 👍 Always great to have invariant encoded in the type system.
| } | ||
|
|
||
| }; | ||
| impl_array_type! { |
There was a problem hiding this comment.
Smart, I like the syntax and that this can now support returning type objects from different APIs.
Ok, I update only
I will update the changelog in the next days. |
|
Changelog updated, I hope I haven't forgotten anything! |
Icxolu
left a comment
There was a problem hiding this comment.
Thank you very much (and sorry it took me a while to get back to this). LGTM.
This PR contains the implementation discussed in #534. The
npyffimodule has been updated to match the NumPy implementation of ABI v2 when theNPY_FEATURE_VERSIONmacro is set to 0x0000000c (v1.15). Some new macros are required for the implementation, I prefer to follow the same layout of NumPy to make easier future changes.The major changes of this PR are:
NonNullmarker is used to store the pointer contained in capsules.T([u8; 0]).npy_longdoublehave been commented; previously they were related tof64, but on some platforms long double is 80-bit extended precision.During the implementation, some doubts arose:
std::os::rawused? Usuallystd::ffiis preferred.Option<...>? I found that the usage ofOption<...>is more common in member definitions, probably even inpyo3. For example: