Fun with Python 3.8 and Qt

Today I discovered the this struct typedef struct{ const char* name; int basicsize; int itemsize; unsigned int flags; PyType_Slot *slots; /* terminated by slot==0. */ } PyType_Spec; with "PyTypeSlot *slots" being on line 190 of object.h causes a problem when compiled with code that brings in Qt. Qt has macro definitions of slots. With a cursory preprocessing of the file I was working with, using the handy gcc options -dM -E, I found that slots was defined to nothing #define slots and hence caused problems when object.h was brought into the mix. I will try to make a simple reproducer tomorrow. I know this probably could be solved by header file inclusion re-ordering, or in some cases #undef'ing slots before including Python.h, but I also thought the Python dev team would like to know about this issue. Tom

It's known: https://bugs.python.org/issue38007 On Mon, Oct 21, 2019, at 20:11, Kacvinsky, Tom wrote:

Hey, we also found the same issue last year, the solution was to un-define use and re-define https://code.qt.io/cgit/qt-creator/plugin-pythonextensions.git/tree/docs/plu... Here you have the code example of the workaround: https://code.qt.io/cgit/qt-creator/plugin-pythonextensions.git/tree/plugins/... Cheers On 10/22/19 5:11 AM, Kacvinsky, Tom wrote:
-- Dr. Cristián Maureira-Fredes https://maureira.xyz

It's known: https://bugs.python.org/issue38007 On Mon, Oct 21, 2019, at 20:11, Kacvinsky, Tom wrote:

Hey, we also found the same issue last year, the solution was to un-define use and re-define https://code.qt.io/cgit/qt-creator/plugin-pythonextensions.git/tree/docs/plu... Here you have the code example of the workaround: https://code.qt.io/cgit/qt-creator/plugin-pythonextensions.git/tree/plugins/... Cheers On 10/22/19 5:11 AM, Kacvinsky, Tom wrote:
-- Dr. Cristián Maureira-Fredes https://maureira.xyz
participants (3)
-
Benjamin Peterson
-
Cristián Maureira-Fredes
-
Kacvinsky, Tom