Maxwell Bernstein <tekk.nol...@gmail.com> added the comment: See for example the following C program:
``` #define Py_LIMITED_API #include "Python.h" int main() { Py_Initialize(); PyObject* foo; PyIter_Check(foo); } ``` when compiled (gcc test.c `pkg-config --cflags python3`) produces: ``` In file included from /usr/include/python3.6m/Python.h:135:0, from test.c:3: test.c: In function ‘main’: /usr/include/python3.6m/abstract.h:712:20: error: dereferencing pointer to incomplete type ‘struct _typeobject’ ((obj)->ob_type->tp_iternext != NULL && \ ^ test.c:8:3: note: in expansion of macro ‘PyIter_Check’ PyIter_Check(foo); ^~~~~~~~~~~~ /usr/include/python3.6m/abstract.h:713:38: error: ‘_PyObject_NextNotImplemented’ undeclared (first use in this function); did you mean ‘PyObject_HashNotImplemented’? (obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented) ^ test.c:8:3: note: in expansion of macro ‘PyIter_Check’ PyIter_Check(foo); ^~~~~~~~~~~~ /usr/include/python3.6m/abstract.h:713:38: note: each undeclared identifier is reported only once for each function it appears in (obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented) ^ test.c:8:3: note: in expansion of macro ‘PyIter_Check’ PyIter_Check(foo); ^~~~~~~~~~~~ ``` ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue40704> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com