On Fri, Mar 13, 2009 at 12:42 PM, Carl Witty <carl.wi...@gmail.com> wrote: > On Fri, Mar 13, 2009 at 12:53 AM, Stefan Behnel <stefan...@behnel.de> wrote: >>> I don't understand why I'm getting the error. If I call a cdef function >>> instead of a cdef method, it works OK; but shouldn't I be able to call a >>> cdef method and passing a C type instead of a Python type? Otherwise, I >>> will need to add an external cdef function for each class to create the >>> object from the struct... I must be doing something wrong :). >> >> I consider this a deficiency of Cython. It should know the type of the >> result when you call an extension type. >> >> http://trac.cython.org/cython_trac/ticket/232 > > Hmm... I hope that eventually Cython will allow overriding __new__, at > which point calling an extension type won't necessarily return a value > of that type. (I see that Robert already made this point in a comment > on the ticket.) >
But if a typecheck is done, we could dispatch a (polymorfic) C call of a Python call... Am I missing something? -- 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 Cython-dev@codespeak.net http://codespeak.net/mailman/listinfo/cython-dev