-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
Milestone
Description
Describe the bug
For some cases casting PyObject * is failing during compilation with error: Cannot convert 'PyObject *' to Python object
To Reproduce
Following code is compiling with no error:
from cpython.ref cimport PyObject
foo = {"abc": 123}
cdef PyObject *bar = <PyObject *> fooBut in pure python version is failing:
import cython
from cython.cimports.cpython.ref import PyObject
foo = {"abc": 123}
bar: cython.pointer(PyObject) = cython.cast(cython.pointer(PyObject), foo)Expected behavior
Pure python mode should reflect cython language.
Environment (please complete the following information):
- OS: Linux
- Python version: 3.9.2
- Cython version: master branch