Passing arbitrary object to njit function

I am trying to pass an object that is not instance of jit class to an njit function, and use its method in objmode. How do I go about this? Or is it possible to use constructor of the class in objmode?

in plain Numba, you can use an object in objmode but you cannot pass it as parameter. This is an example:

my_object = .... #something

@njit
def foo():
    with objmode():
        my_object.do_something()

If you need to pass it as a parameter, you can try using this library https://github.com/asodeur/numba-passthru