Hi,

so, I stumbled about some funny behaviour with Python 3 support. Pretty 
sure those are bugs, however as I don‘t have a Trac account, I‘ll report 
them here; hope that‘s OK.

i) As you may know, support for __cmp__ is gone in Python 3 - the 
relevant field in the type object structure has turned from ``cmpfunc 
tp_compare`` into ``void *reserved``. However, the Cython compiler even 
on Python 3 tries to put the comparison function into that slot:

   0, /*tp_setattr*/
   __pyx_pf_6bullet_9datatypes_7vector3___cmp__, /*tp_compare*/
   __pyx_pf_6bullet_9datatypes_7vector3___repr__, /*tp_repr*/

That works fine with C, however it doesn‘t with C++:

bullet/datatypes.cpp:4835: error: invalid conversion from ‘int 
(*)(PyObject*, PyObject*)’ to ‘void*’

ii) The header files that get generated when you use ``public`` in the 
Cython code use the DL_IMPORT (and DL_EXPORT?) macro, which, again, 
seems to have disappeared with Python 3 (it has been deprecated since 
2.3 already). The endorsed replacement, it appears, are the PyAPI_* macros.

So, I hope it‘s clear what I mean. For the record, I‘m using Ubuntu 
10.04 64-bit, Python 2.6.5 and 3.1.2, GCC 4.4.3 and Cython tip, 
changeset 3adaf1ef25b9 as I‘m writing.

Regards,
Felix
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to