Say I have a class:
@numba.experimental.jitclass([
('foo', numba.int64),
])
class foo(object):
def __init__(self, foo):
self.foo = foo
And another class which takes, as input, a list of these classes:
@numba.experimental.jitclass([
('bar', numba.types.ListType(foo)),
])
class bar(object):
def __init__(self, bar):
self.bar = bar
bar(numba.typed.List([foo(1)]))
Doing the above results in an error. I can fix it by doing:
@numba.experimental.jitclass([
('bar', numba.types.ListType(numba.typeof(foo(1)))),
])
class bar(object):
def __init__(self, bar):
self.bar = bar
bar(numba.typed.List([foo(1)]))
But I don’t like having to instantiate a class like foo(1)
and using numba.typeof
. Is there a way to do the above without having to instantiate the class and using typeof
?