I have a simple test.py
file where I want to add types using Cython. To stay python interpreter compatible, I use the pure python mode. I added:
import cython
And then try to define a type by:
d = cython.declare(cython.dict)
Then the python interpreter in Eclipse gives me an error on this line:
AttributeError: 'module' object has no attribute 'dict'
What did I miss? When I rename test.py to test.pyx it works, but I want to keep it as a .py file to be able to import it in other python files.
Just use d = cython.declare(dict)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With