Python Class __new__ method

Does your class inherit from "object", to make it a new style class? That's required in Python 2.

Thank you for properly addressing the XY problem :slight_smile:

This way lies danger. I don't know what cache you're using or exactly how, but it is unsafe (read: causes memory leaks) to store user defined Jython classes between script interpreter restarts, which Ignition does all the time, under the hood. I would urge you to cache whatever expensive data or state you need as pure Python dicts/lists with other primitives into that cache and reconstitute your class based on that, rather than trying to persist instances.

3 Likes