Skip to content

add method PyCapsule::import_pointer - #6066

Merged
davidhewitt merged 5 commits into
PyO3:mainfrom
Person-93:py_capsule_import_raw
Jun 4, 2026
Merged

davidhewitt merged 5 commits into
PyO3:mainfrom
Person-93:py_capsule_import_raw

Conversation

@Person-93

Copy link
Copy Markdown
Contributor

Closes #6065

@davidhewitt davidhewitt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, especially after https://github.com/PyO3/pyo3/pull/6064/changes#r3294281158 this looks like a very good idea.

Given we have PyCapsuleMethods::pointer already, should we call this import_pointer instead of import_raw? I think I prefer _pointer slightly, though I could be persuaded _raw is better.

@Person-93

Copy link
Copy Markdown
Contributor Author

I'm fine with _pointer.

I've also added a check for pointer alignment in the regular import function.

@Tpt Tpt changed the title add method PyCapsule::import_raw add method PyCapsule::import_pointer May 24, 2026
@Person-93
Person-93 requested a review from davidhewitt May 26, 2026 20:30

@davidhewitt davidhewitt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@davidhewitt
davidhewitt added this pull request to the merge queue Jun 4, 2026
Merged via the queue into PyO3:main with commit 1e5d76d Jun 4, 2026
49 checks passed
@Person-93
Person-93 deleted the py_capsule_import_raw branch June 5, 2026 00:13
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.

Import capsule as pointer

2 participants