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
We are in the situation where we are trying to move a library currently implemented in Python to an implementation in C++ which is then wrapped with nanobind to provide a backwards compatible version on the Python type. We are also taking the opportunity to redesign.
That is leaving us in the situation where we have these vast and terrible Python APIs we need to service, but that we don't want or need in C++. The obvious solution is to put this in the binding layer. But that is turning into an ordeal as that binding layer is mostly just calling Python functions like the Python would, and when not tends to be pretty complicated.
So I had an idea to leave the wrapper stuff in Python and have the Python class just wrap the new core object which providing the additional Pythonic I/O. Then of course I'd have to create a type caster between these Python types and the C++ type to "unwrap" the nanobinded class. Since the impl object is nanobinded, I think this would be fairly cheap: unwrap and rewrap.
Just wondering if anyone has had to do this before / looking for examples.
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
We are in the situation where we are trying to move a library currently implemented in Python to an implementation in C++ which is then wrapped with nanobind to provide a backwards compatible version on the Python type. We are also taking the opportunity to redesign.
That is leaving us in the situation where we have these vast and terrible Python APIs we need to service, but that we don't want or need in C++. The obvious solution is to put this in the binding layer. But that is turning into an ordeal as that binding layer is mostly just calling Python functions like the Python would, and when not tends to be pretty complicated.
So I had an idea to leave the wrapper stuff in Python and have the Python class just wrap the new core object which providing the additional Pythonic I/O. Then of course I'd have to create a type caster between these Python types and the C++ type to "unwrap" the nanobinded class. Since the impl object is nanobinded, I think this would be fairly cheap: unwrap and rewrap.
Just wondering if anyone has had to do this before / looking for examples.
All reactions