You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to check if a type object is equivalent to any C++ type i binded, but it seems that i can't really retrieve python type of standard types like those (py::type::of<int>() fail at compile time). I don't mind to write specialization for them, but I can't even find a way to check if a python type object is a int/float.
I guess I could just call py::eval and pass my py::object as a local variable, but I hoped there was a cleaner solution for this.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to check if a type object is equivalent to any C++ type i binded, but it seems that i can't really retrieve python type of standard types like those (
py::type::of<int>()
fail at compile time). I don't mind to write specialization for them, but I can't even find a way to check if a python type object is a int/float.I guess I could just call py::eval and pass my py::object as a local variable, but I hoped there was a cleaner solution for this.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions