Cython runtime exception when invoking method single arg with keyword

Viewed 120

I have python code that I convert to Cython. I get a runtime exception on the following scenario:

class A:
   def foo(self, some_arg: int):
       pass
    
a = A()
some_arg = 5
a.foo(some_arg=some_arg)

The error is:

TypeError: foo() takes no keyword arguments

I found some relevant data here. However:

  1. The error is in runtime, not compile time as I would expect.
  2. When adding to the setup.py file a compliler directive always_allow_keywords=True as suggested, I get corrupted .so files upon cythonizing the code. When I try to load them I get this error: file xxx.so is too short.

My Python version is: 3.7.2, cython version: 0.29.19. The code is compiled with gcc-linaro-aarch64 toolchain and run on a Linux based OS.

0 Answers
Related