Hi, thanks for the report.
Riccardo Murri wrote: > while converting a class from pure Python to Cython, I've come across > the following: > > $ cat r.pyx > cdef class r(object): > cdef long long n > cdef long long d > > def __init__(self, long long n, long long d): > self.n = n > self.d = d > > def __int__(self): > return (self.n // self.d) > > __long__ = __int__ > > $ cython -v r.pyx > Compiling /tmp/r.pyx > > $ gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall > -Wstrict-prototypes -fPIC -I/usr/include/python2.5 -c r.c -o r.o > r.c:487: error: âNoneâ undeclared here (not in a function) > > $ sed -e '484,490!d;488i^^^^^^^^^^^^^^^^^^^^^^^^ up here' r.c > 0, /*nb_coerce*/ > #endif > __pyx_pf_1r_1r___int__, /*nb_int*/ > None, /*nb_long*/ > ^^^^^^^^^^^^^^^^^^^^^^^^ up here > 0, /*nb_float*/ > #if PY_MAJOR_VERSION < 3 > 0, /*nb_oct*/ Yes, that's a bug. I assume that the above code does not make Cython set up the C level function name. Raising an error here would work for now. > I understand that "__long__ = __int__" is not the correct way to do > method aliasing in Cython ... and that's a feature request, it would be nice to make that work. Could you create two tickets for those? http://trac.cython.org/cython_trac/ If you don't have a trac account yet, please send a htpasswd password line to Robert Bradshaw. Thanks! Stefan _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
