Skip to content

add method PyCapsule::import_pointer#6066

Open
Person-93 wants to merge 5 commits into
PyO3:mainfrom
Person-93:py_capsule_import_raw
Open

add method PyCapsule::import_pointer#6066
Person-93 wants to merge 5 commits into
PyO3:mainfrom
Person-93:py_capsule_import_raw

Conversation

@Person-93
Copy link
Copy Markdown
Contributor

Closes #6065

Copy link
Copy Markdown
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, 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
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