I want to use a dictionary inside nogil. I've read this question and the comments by @DavidW:
Cythonize python dictionary object
So I tried doing this in file.pyx:
# cython: language_level=3
cimport cpython.dict
cdef cpython.dict some_cdict
And my setup.py file looks like this:
from setuptools import setup
from Cython.Build import cythonize
import numpy as np
setup(
ext_modules=cythonize('file.pyx', annotate=True),
include_dirs=[np.get_include()]
)
And this is my call to compile it:
python setup.py build_ext --inplace
But I get this error:
file.pyx:3:5: 'dict' is not a type identifier
What am I doing wrong?
I also saw this solution but I would much rather use objects from CPython than libcpp: