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
Hi!
I was wondering if the Pybind11 framework provides a solution for module initialization and finalization. My use case is that my module's functions and classes use libraries that have to be initialized and finalized, and I would like to define a piece of code which would be automatically executed right after the module import, and another one right before unloading the module.
I ended up using the following trick which seems to work, but is there a better way?
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.
-
Hi!
I was wondering if the Pybind11 framework provides a solution for module initialization and finalization. My use case is that my module's functions and classes use libraries that have to be initialized and finalized, and I would like to define a piece of code which would be automatically executed right after the module import, and another one right before unloading the module.
I ended up using the following trick which seems to work, but is there a better way?
Beta Was this translation helpful? Give feedback.
All reactions