How to Reload internal python Modules w/o restart?

TD not updating changes in internal Python modules without restart:
how to reload internal python module in touchdesigner after editing them without restarting project?

The main script is docked in Script SOP, and modules (classes) in text DATs. Except this edit/restart issue they seems to work fine.

Best,
Andrey

Note:
The problem exist only w. class methods

Unfortunately, when you instantiate a class it’s methods are ‘baked’ into it. It no longer references the DAT that defined it. You need to recreate the object to get it to use any code changes you made in it’s definition.

Is this still the case? I was able to semi-automate this by using a DAT Execute watching the Text DAT that contains my local module, and when it changes, it toggles the bypass flag on a callbacks DAT that imports my local module. Certainly better than restarting, or needing to manually toggle the bypass on every save, but I’m curious if there’s a built-in way now that doesn’t require the extra setup?

imports should (even back when the original post was made I think) work fine without doing anything manual. Changing a Text DAT that is imported by another one will be picked up next time that other one runs.
The part that is manual is the object instances that you are keeping around. Those get code baked into them, so they need to be re-instantiated to get the new code. There really isn’t any way for us to do that automatically since there is no way for us to know where or how an object pointer being held somewhere came from or how to re-instantiate it.

@mattfelsen Can you please share your workaround? I’m facing the same issue. I’m changing code in internal .py files that are not directly linked to any OP, and need to restart TD every time. It’s very frustrating.

Oof, 4 years later, I wish I could! I’m not sure which project I was working at the time, and I looked at one but didn’t see anything relevant. Sorry!