Robert Bradshaw wrote: > On Feb 11, 2009, at 12:47 PM, Lisandro Dalcin wrote: > >> Please also note that the code below also fails to cythonize. I bet >> this gotcha is not related to my latest patches for 'size_t' >> >> >> cdef class A: >> cdef readonly Py_ssize_t n > > Well, yes and no. People used to be able to write "ctypedef unsigned > long size_t" and have it work.
Well, not to be a pedantic nit picker, but as we all should know now the above is not correct. It tends to work on most systems, but enabling people to do dumb things should not have priority over correct code. Sage has the same issue that someone defined size_t to be unsigned long and I could look up who did that, but I have a good idea who wrote that code, so no need to point fingers :) Maybe the 0.11 release notes should prominently feature this change and show how to fix the problem? This might also be something where Pyrex and Cython have diverged, i.e. I assume the above is "legal" in Pyrex while it won't work in Cython 0.11 or later, so in that case it should be added to the wiki page in the Cython wiki where differences are listed. > I pushed a fix and some tests. The public attribute stuff is slightly > hacky, but I'm going to be revising that to handle complex types > anyways. > > BTW, I didn't see ulong <= size_t <= ulonglong ordering in PyrexTypes > yet, did we get consensus on this? > > - Robert Cheers, Michael > _______________________________________________ > Cython-dev mailing list > [email protected] > http://codespeak.net/mailman/listinfo/cython-dev > _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
