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

[internal] Refactor TypeId, Key, and Value for rust-cpython FFI #13514

Merged

Conversation

Eric-Arellano
Copy link
Contributor

This switches from several free functions in externs/mod.rs to instead implement methods on TypeId, Key, and Value. That's more idiomatic.

The new methods also tend to take py: Python now, rather than force-acquiring the GIL. This allows sharing the GIL across several function calls, which the PyO3 maintainers shared can be much more efficient to avoid overhead: #12451 (comment)

Finally, this deduplicates when Debug and Display had the same implementations.

[ci skip-build-wheels]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
Copy link
Contributor

@tdyas tdyas left a comment

Choose a reason for hiding this comment

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

lgtm

@Eric-Arellano Eric-Arellano merged commit 4301cb4 into pantsbuild:main Nov 7, 2021
@Eric-Arellano Eric-Arellano deleted the rust-cpython-python-file branch November 7, 2021 17:19
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.

2 participants