Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cython pure python mode

Tags:

python

cython

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.

like image 470
dominicp Avatar asked Oct 18 '22 14:10

dominicp


1 Answers

Just use d = cython.declare(dict)

like image 84
MANA624 Avatar answered Oct 21 '22 07:10

MANA624