Hot-reloading #1151
stellarpower
started this conversation in
General
Hot-reloading
#1151
Replies: 0 comments
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.
-
Hi,
I'm working on a Panel applet; after moving the numerical work into C++, I am having some problems with the hot-reloading it seems. When I save a file and panel does whatever black magic to reload the files in the Python interpreter, it seems the nanobind module definition is being called again.
The issue I have is that if I guard against redefining things in NB_MODULE, on the reload types are missing from the module. Whilst if I don't the application aborts with e.g.:
So it seems somehow at least one enum is persisting across the reload whilst other classes are not.
Does nanobind support reloading through whatever importlib stuff is happening, is this a known limitation or should it "just work"? I'm not au fait with what happens behind the scenes when a module is reloaded but it seems odd as I'd hope either everything gets thrown away and starts again or persists in memory and should be guarded against given it's a native code module. I won't be surprised however if not given Python hasn't exactly grasped RAII yet ;)
Thanks
Beta Was this translation helpful? Give feedback.
All reactions