Assuming you have such a function, and you're fine, referring to it as an attribute, not an index:
import numba as nb
@nb.njit
def func(config):
return config.c
collections.namedtuple (, @JoshAdel):
import numpy as np
from collections import namedtuple
conf = namedtuple('conf', ['a', 'b', 'c'])
func(conf(1, 2.0, np.array([1,2,3], dtype=np.int64)))
jitclass:
spec = [('a', nb.int64),
('b', nb.float64),
('c', nb.int64[:])]
@nb.jitclass(spec)
class Conf:
def __init__(self, a, b, c):
self.a = a
self.b = b
self.c = c
func(Conf(1, 2.0, np.array([1,2,3], dtype=np.int64)))
, " " .