Gre, the (Cython) docs say this Special Method Table --------------------------------- This table lists all of the special methods together with their parameter and return types. A parameter named self is of the type the method belongs to. Other untyped parameters are generic Python objects.
What do you understand for 'A parameter named self is of the type the method belongs to'. Anyway, do not you believe the current behavior is a bit counter-intuitive? On 5/10/08, Greg Ewing <[EMAIL PROTECTED]> wrote: > Lisandro Dalcin wrote: > > I believe you are right, it seems a bug, > > > > > cdef class myTest > > def __add__(myTest self, other): # note declaration: myTest self > > return self.thisPtr.add(other) > > > It's not a bug. With extension types, the first argument > of operator methods isn't necessarily self, so it's not > automatically typed as such. > > See the section on Special Methods of Extension Types in > the docs for a full explanation. > > -- > > Greg > > _______________________________________________ > Cython-dev mailing list > [email protected] > http://codespeak.net/mailman/listinfo/cython-dev > -- Lisandro Dalcín --------------- Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC) Instituto de Desarrollo Tecnológico para la Industria Química (INTEC) Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET) PTLC - Güemes 3450, (3000) Santa Fe, Argentina Tel/Fax: +54-(0)342-451.1594 _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
