Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Mar 8, 2022

Conversation

adamreichold
Copy link
Member

@adamreichold adamreichold commented Mar 8, 2022

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
Copy link
Member Author

@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.

Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep this seems like the correct fix to me. In general it scares me when numpy does things that we don't really want other users to be doing, like implementing #[pyclass] manually, so I'm in favour of this 👍

@adamreichold adamreichold merged commit e65410d into main Mar 8, 2022
@adamreichold adamreichold deleted the fix-multiple-py-methods branch March 8, 2022 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compilation fails when using PyO3's multiple-pymethods feature
2 participants