PyO3 / rust-numpy

PyO3-based Rust bindings of the NumPy C-API
BSD 2-Clause "Simplified" License
1.11k stars 106 forks source link

Use the pyclass proc-macro to produce the implementation details of PySliceContainer. #288

Closed adamreichold closed 2 years ago

adamreichold commented 2 years ago

I chose to use the pyclass proc macro instead of trying to use features or cfgs to reduce the long-term maintenance burden as PySliceContainer is not special when comes to PyClassImpl implementors. This does mean we require PyO3's proc macros and the associated build time hit, but I suspect that the target audience using rust-numpy but not PyO3's proc macros is sufficiently limited to make this worthwhile. (I did not yet check whether there are other places in the code that could benefit from using the proc macros, but I don't expect it.)

Fixes #287

adamreichold commented 2 years ago

@davidhewitt I think it would be good to release this as 0.16.1 if we agree on the approach, so ideally before #285 is merged which will be a breaking change.