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

add some style guide to Contributing.md #3273

Merged
merged 6 commits into from
Jul 5, 2023

Conversation

davidhewitt
Copy link
Member

Born out of the discussion in #3270 (comment)

Contributing.md Outdated Show resolved Hide resolved
@davidhewitt
Copy link
Member Author

Updated and added a commit which applies these two rules to a number of our FFI calls.

@davidhewitt davidhewitt added the CI-skip-changelog Skip checking changelog entry label Jul 4, 2023
src/err/mod.rs Outdated Show resolved Hide resolved
src/types/sequence.rs Outdated Show resolved Hide resolved
@adamreichold
Copy link
Member

Wow, this is a lot of generic code to support impl ToPyObject arguments. Certainly not for this PR, but I do wonder whether &dyn ToPyObject might even be a good trade-off for these kinds of API?

@davidhewitt
Copy link
Member Author

Pushed a few commits to apply the suggestions, and also move unsafe { } blocks inside of error_on_minusone calls as reducing scope of the unsafe seemed like a good idea.

Wow, this is a lot of generic code to support impl ToPyObject arguments. Certainly not for this PR, but I do wonder whether &dyn ToPyObject might even be a good trade-off for these kinds of API?

Personally I think this is probably the right level, if users want to have only a single monomorphization I think they can select the &dyn ToPyObject instantiation directly?

@adamreichold
Copy link
Member

Personally I think this is probably the right level, if users want to have only a single monomorphization I think they can select the &dyn ToPyObject instantiation directly?

Agreed, disciplined users can opt into this by always calling with &dyn ToPyObject.

@davidhewitt davidhewitt added this pull request to the merge queue Jul 5, 2023
Merged via the queue into PyO3:main with commit edb62e0 Jul 5, 2023
@davidhewitt davidhewitt deleted the conventions branch July 5, 2023 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-skip-changelog Skip checking changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants