-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Design goal of HPyCapsule conflicts with universal mode #447
Comments
I think we should review this design goal, and HPyCapsule should be a pure-c struct with no |
In HPy, we don't have a type HPy h_capsule = HPyCapsule_New(ctx, ptr, "name", destructor);
PyCapsule *py_capsule = (PyCapsule *)HPy_AsPyObject(ctx, h_capsule); This is basically what I meant with:
Further, the goal was that you can create a capsule object in a C API extension using
IMO, the goal is fulfilled because in HPy, we are not exposing internal of the capsule object. So, we can implement it as we want and in case of CPython, we implement it as What problems are you running into? |
None so far, just thinking about how to implement this in PyPy. It seems we should have a HPyCapsule which is
|
Also it seems HPy_SetCallFunction can only be used in hybrid mode, but is tested in universal mode. |
Why do you think that int HPy_SetCallFunction(HPyContext *ctx, HPy h, HPyCallFunction *func) Type typedef struct {
cpy_vectorcallfunc cpy_trampoline;
HPyFunc_keywords impl;
} HPyCallFunction; For type Anyway, are you running into any problem implementing this function? |
OK, I will try. |
And you assign it to the object's |
Yes, on GraalPy, we install a special built-in function to attribute |
Closing, thanks for the help. |
When trying to implement the HPyCapsule interfaces for PyPY, I see the design goal is
How will that play out when we want to use universal mode? The struct is defined as
so it needs a CPython
PyObject
.The text was updated successfully, but these errors were encountered: