Is there a way to use Sorted Dict in njit-function?

…or any C++ extension code?

For example, there a sortedcontainers package that provide SortedList class realized as C++ extension. How can I create the instance of it inside njit-code?

@zxweed Numba doesn’t support calling C++ compiled/extension libraries at present. If you wrap the functions you want to call in a C library Numba does have support for ctypes bindings and calls could be made through that: Supported Python features — Numba 0.54.1+0.g39aef3deb.dirty-py3.7-linux-x86_64.egg documentation (define a CFUNCTYPE for the pointer to the C function and call it from inside @njit) code.

1 Like