Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
REQ: recipe/docs for creating a buffer-protocol class by wrapping another #3048
I've got a python-space class that is a thin wrapper around a np.ndarray, and I'd like to make this into a buffer-protocol-compliant cython class so I can pass it to memoryview-expecting cython functions without having to unwrap it every time.
My intuition was that this would look like
When I do this, I get a compile-time error pointing to
So the request is for a recipe or docs on how to create one memoryview-class that just wraps another.
These magic methods are invented by Cython, they're not actually part of the API. What you want to do is call the C-API function