I have a module with functions that I compile without any manual optimizations. The normal version of the code looks like:
I then tried modifying the function to use C-type declarations like so:
The function doesn't return anything, and all the variables are of the correct type.
In my main program, I'm dynamically importing different modules using `importlib` based on a JSON file's parameters - basically letting a user choose what modules to import rather than importing all the modules. I do this through a snippet like this:
Where `info["package"]` is the top-level package of my module, and `info["library"]` is the actual module's full name. The last line is where I assign the `Main_Default` function to a dictionary value where I'll call it later.
All works fine in the first scenario where I'm using Python function declaration, where I'm met with the success message and the module runs fine when it's called.
The issue is that when using C-type function declarations, Importing the module works fine (as I still get the success message), but when trying to assign the `Main_Default` function of the module I get the following error message:
I printed out the vars(lib) for my module just to make sure the function was listed, and the `Main_Default` function is not listed.
I believe this is due to `importlib` using the Python `import` function, while in this case I'd want to use Cython's `cimport` function.
I also tried changing the `cdef` to `cpdef` which should work, but then I'm met with this error:
```
cpdef void Main_Default(int value_max, int num_loops, rlock, str runtime, str compilation, str call_type, str subcall, str case):
^
------------------------------------------------------------
my_package.my_module.pyx:14:6: closures inside cpdef functions not yet supported
```
Any way I can use `importlib` or some similar dynamic method for Cython extensions?