Skip to content

Conversation

@blowekamp
Copy link
Member

Sharing code I wrote to play around with PEP 688 in ITK Python.

@blowekamp blowekamp requested a review from thewtex November 28, 2025 13:12
@github-actions github-actions bot added area:Python wrapping Python bindings for a class type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:Bridge Issues affecting the Bridge module area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module labels Nov 28, 2025
@blowekamp
Copy link
Member Author

blowekamp commented Nov 28, 2025

@thewtex I don' have any intention of taking this change further. I am just sharing the code in case it's useful for exploring this new python feature in ITK Python. It has recently been implemented in SimpleITK.

This PR can be closed without merging.

Experiment with implementing PEP 688.

Replace __array__ with __buffer__. Convert memoryview to correctly
specified n-d view.

PEP 688 automatically maintains a a reference to the provider of the
buffer.

Add incomplete wrapping for the import image container, and buffer
interface.
@github-actions github-actions bot removed the area:Filtering Issues affecting the Filtering module label Nov 28, 2025
@hjmjohnson hjmjohnson marked this pull request as draft November 28, 2025 14:16
@hjmjohnson hjmjohnson changed the title PEP 688 demonstration WIP: PEP 688 demonstration Nov 28, 2025
@thewtex
Copy link
Member

thewtex commented Dec 5, 2025

@blowekamp wow! Awesome! Thank you so much for contributing this!

I'll push it forward

@blowekamp
Copy link
Member Author

There may additional useful information related to this here: SimpleITK/SimpleITK#2447

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Bridge Issues affecting the Bridge module area:Core Issues affecting the Core module area:Python wrapping Python bindings for a class type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants