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

Make the Py_tracefunc parameters optional #1692

Merged
merged 2 commits into from
Jun 24, 2021
Merged

Make the Py_tracefunc parameters optional #1692

merged 2 commits into from
Jun 24, 2021

Conversation

GabrielMajeri
Copy link
Contributor

The PyEval_SetProfile/SetTrace methods support receiving NULL for the Py_tracefunc parameter, in order to disable profiling/tracing. However, the only way to safely pass NULL as a function pointer in Rust is by wrapping it in an Option<>.

This PR updates the respective functions to make it easier for developers to disable profiling/tracing hooks, without having to resort to transmute or zeroed.

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.

👍 thanks!

@davidhewitt davidhewitt merged commit 1480829 into PyO3:main Jun 24, 2021
@GabrielMajeri GabrielMajeri deleted the make-tracefunc-optional branch June 24, 2021 08:23
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.

None yet

2 participants