Change builtin type caster: const char* to bytes
#1104
Replies: 2 comments
-
|
It seems like I could use this to achieve my goal: -int f(const char* buf) {
+int f(nb::bytes buf) {This seems to rely on wrappers instead of type-casters. I'm curious if this is the recommended solution? (Is there a way to do this which just uses type casters?) |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Nanobind will not let you pass a Python |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In this setup, the function
fuses the type casterstrtoconst char*.This means that it is not possible to call
fwith abytesobject:The association from
const char*seems to be hardcoded innb_cast.h. I'm curious if there is a way to override this? Namely, the binding function takesbytesas input instead ofstr?Beta Was this translation helpful? Give feedback.
All reactions