Skip to content

deprecate optional GIL Ref in function argument#3975

Merged
davidhewitt merged 1 commit intoPyO3:mainfrom
davidhewitt:option-gil-ref-deprecation
Mar 21, 2024
Merged

deprecate optional GIL Ref in function argument#3975
davidhewitt merged 1 commit intoPyO3:mainfrom
davidhewitt:option-gil-ref-deprecation

Conversation

@davidhewitt
Copy link
Member

This PR adjusts the GIL Refs deprecation warning machinery so that Option<&T> emits deprecation warnings for GIL Refs in function arguments.

Initially in #3847 I wasn't going to bother, but it seems worth it given that Option<&T> is quite a common pattern and sort of has special support in PyO3 for other functionality like optional arguments.

Indeed, adding this warning caught a few final GIL Refs sneaking around in our codebase 👀

@davidhewitt davidhewitt added the CI-skip-changelog Skip checking changelog entry label Mar 20, 2024
@davidhewitt davidhewitt mentioned this pull request Mar 20, 2024
@davidhewitt davidhewitt added this pull request to the merge queue Mar 21, 2024
Merged via the queue into PyO3:main with commit 351c6a0 Mar 21, 2024
@davidhewitt davidhewitt deleted the option-gil-ref-deprecation branch March 21, 2024 08:10
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