Trying to check the identity of two jitclass instances attributes, I found this strange behaviour compared to ordinary python classes. Numba jitclass return False on its own instance attribute identity check where ordinary python classes work as expected.
import numba
class MyClass(object):
def __init__(self, x):
self.x = x
spec = [('x', numba.double)]
@numba.jitclass(spec)
class MyJitClass(object):
def __init__(self, x):
self.x = x
a = MyClass(1)
b = MyJitClass(1)
Now checking the identity:
>>> a.x is a.x
True
>>> b.x is b.x
False
Any idea why this happens? And how I should check whether two jitclass attributes reference to the same object?