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.
只需使用d = cython.declare(dict)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.