I am trying to use jitclass with node class that is used for a tree structure. The problem is that I am not able to store the parent object reference. I tried types.pyobject but wasn’t successful.
Now this is a bit of a head scratcher. You would want the type of self.parent to be the type associated with the Nodes class, but that is not (obviously) available when you are defining the type spec needed for the compilation in order to create the type.
Is using jitclass ultimately necessary here or could you get away with a simpler, more basic data structure? (Obviously depends a little on what you are planning to do going from here)
That said, I think there is a possible solution to your problem hidden in the numba test suite
It seems like there is a way to delay the type specification so that jitclasses can contain members of their own type. @sklam probably has more insight into this