Skip to content

Compile Error when using C-API with Limited API on new Numpy 2.0 #26756

@ids-pas

Description

@ids-pas

Hi all,

we are using numpy.i to integrate into our own Python bindings via SWIG and are building against the limited API.

Now that numpy 2.0 has been released we wanted to update our bindings to be compiled with numpy 2.0,
but stumbled onto this compile error:
Python312\site-packages\numpy\_core\include\numpy\dtype_api.h(452,5): error C2664: 'void Py_INCREF(PyObject *)': cannot convert argument 1 from 'PyArray_DTypeMeta *' to 'PyObject *'
Is there a "_PyObject_CAST" missing at:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions