Reloading Classes in Python
andrewpwheeler.com
andrewpwheeler.com
Worse, you can't redine methods, because the classes get "redefined". This means that you need to first redefine classes, then "reload" (hoping it doesn't break for to silly implementation limitations mentioned above), then initialize objects, then retest.
Obviously this is quite painful which is why I use this decorator to mimic Lisp's defmethod to patch methods on "live" objects without class redefinition,
https://gist.github.com/akssri/431f2dfe037bbdbb3c8668872edfd...
Pickles aren't signed and pickle is basically eval().
import tui
state = {"current_step_index": 0, "variables": None}
while True:
app = tui.App(state)
tui.run()
state = app.get_state()
importlib.reload(tui)