Replies: 1 comment 1 reply
-
It seems that A solution would be to create a thin wrapper that takes a In particular, I have no idea of what to give to the Any help ? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dear
nanobind
community,I am a new
nanobind
user. TheC++
library I want to wrap uses a custom type namedParameters
as the main argument of most of its functions. This type is basically theC++
counterpart of adict
(except that the keys are strings).I already implemented a
type_caster
which allows on the fly conversions between aParameters
and adict
. This works fine. I can wrap a functionf
and pass it adict
:However, as my library uses this type everywhere, I would like to add some syntaxic sugar to my python bindings and allow the following syntax:
My idea was to modify my
type_caster
class to allow conversion from akwarg
. This is the current implementation of thefrom_python
method:As a first try, I just changed the first test:
but that did not seem to work, at least in the case of constructor taking a const reference to a
Parameters
. The error message is:Can anyone help me ?
Beta Was this translation helpful? Give feedback.
All reactions