-
Notifications
You must be signed in to change notification settings - Fork 795
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
Syntax to generate bindings for imported function, module, etc... #1293
Comments
This can't work since the If there is no way for you to apply the attribute directly in |
Interestingly enough I was exploring ways to solve this problem on the weekend. The really interesting thing is that it's possible to have a
The really interesting thing is This means that if we changed However, there's a catch. I filed an issue at rust-lang/rust#79260, and I'm hoping I can energize some consensus on a solution (at least for nightly Rust) which could give us hope to maybe use this pattern in the future in PyO3. |
@davidhewitt if I understand OP correctly they don't want to import a wrapped |
Oh haha yes that's me finding a nail to hit with the hammer 😆 In which case your answer is definitely correct; it's fundamentally impossible for us to write The closest we could come is probably to feed in the function signature to the attribute:
But I think it's much less clear than just writing a normal Note to OP: you don't have to
I think that's the best we should aim to offer here and so I'm going to close this one. |
It would be nice to apply bindings on an imported function like this for example:
Currently this doesn't work:
I can do something like:
But is there a nicer syntax to achieve this?
The text was updated successfully, but these errors were encountered: