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

Minor py::capsule cleanup. No functional change. #4238

Merged
merged 1 commit into from
Oct 12, 2022

Conversation

rwgk
Copy link
Collaborator

@rwgk rwgk commented Oct 12, 2022

Use PyCapsule_Destructor (part of the stable Python ABI) instead of spelling out the C typedef.

The deprecation message is misleading. Replace with a message pointing to another existing ctor.

Background: According to @wjakob the original motivation for deprecating the ctor (in PR #752) was to hide Python C API details, but PR #902 brought those back with a new ctor, it cannot be avoided. Having a PyCapsule_Destructor or a void (*destructor)(void *) are two separate and valid use cases.

Description

Suggested changelog entry:

Use `PyCapsule_Destructor` (part of the stable Python ABI) instead of spelling out the C `typedef`.

The deprecation message is misleading. Replace with a message pointing to another existing ctor.

Background: According to @wjakob the original motivation for deprecating the ctor (in PR pybind#752) was to hide Python C API details, but PR pybind#902 brought those back with a new ctor, it cannot be avoided. Having a `PyCapsule_Destructor` or a `void (*destructor)(void *)` are two separate and valid use cases.
@rwgk
Copy link
Collaborator Author

rwgk commented Oct 12, 2022

Ignoring the CentOS7 / PGI 22.3 failure (also seen in another PR; it seems to be generally broken at the moment).

@rwgk rwgk marked this pull request as ready for review October 12, 2022 22:43
@rwgk rwgk merged commit 964c499 into pybind:master Oct 12, 2022
@rwgk rwgk deleted the capsule_redeprecate branch October 12, 2022 22:43
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Oct 12, 2022
@Skylion007 Skylion007 removed the needs changelog Possibly needs a changelog entry label Oct 12, 2022
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