Skip to content

Question: how to set the name attribute for py::capsule? #894

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

Closed
phaustin opened this issue Jun 8, 2017 · 5 comments
Closed

Question: how to set the name attribute for py::capsule? #894

phaustin opened this issue Jun 8, 2017 · 5 comments

Comments

@phaustin
Copy link
Contributor

phaustin commented Jun 8, 2017

Is it possible to embed the function signature as a string in py::capsule? This is needed for the new scipy lowlevelcallable interface -- something like cython's PyCapsule_New

I don't seem to see it in pytypes.h

thanks, Phil

@jagerman
Copy link
Member

jagerman commented Jun 8, 2017

Not currently supported, I'm afraid, but we'd happily accept a PR to add it.

(It would be quite easy to do by adding an optional const char *name = nullptr argument to the various capsule constructors in pytypes.h, then passing that (instead of nullptr) as the second PyCapsule_New argument. Thus plus a test suite addition to verify that it's working ought to do it).

@phaustin
Copy link
Contributor Author

Easy enough for the first constructor:
c5d2a68

but for the other, would it mean adding name as the third optional argument, so changing the argument order from that expected for PyCapsule_New?

@jagerman
Copy link
Member

jagerman commented Jun 12, 2017

Though leaving just that constructor for specifying the name seems reasonable, too.

@phaustin
Copy link
Contributor Author

ok, see #902

@jagerman
Copy link
Member

Closed via #902.

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

No branches or pull requests

2 participants