On Thu, Oct 14, 2010 at 10:56 AM, Matěj Laitl <[email protected]> wrote: > On 28. 9. 2010 Robert Bradshaw wrote: >> On Tue, Sep 28, 2010 at 10:14 AM, Matěj Laitl <[email protected]> wrote: >> > I have problems with cython dealing with following example case (python >> > 2.6.5, cython 0.13): >> > >> > 2 cdef classes, Pdf and GaussPdf; GaussPdf inherits Pdf. Both are written >> > in pure python file pdfs.py and use augmentation pdfs.pxd for cythoning. >> > (attached) Both have just cpdef methods, GaussPdf overrides 4 of 5 Pdf's >> > methods. When tested as Python code, everything is okay, but when >> > compiled >> > >> > (...) >> > >> > Also, vtabstruct for Pdf seems strange (it contains GaussPdf methods), >> > but that may be correct inheritance magic. >> > >> > Is this really a bug in Cython, or am I doing something completely wrong? >> >> No, this looks like a bug on our side. Clearly the pure mode + >> augmented .pxd is insufficiently tested. I have an idea where it might >> be happening too... > > Okay. Should I file a bug then? (I can attach a testcase maybe)
Yes, please do. > Robert, would you tell your secret about where you think the problem lies? :-) I think this has to do with the order in which method signatures are resolved and the cdef declarations applied. Essentially, it find the superclass method (as it was not overwritten) and applies the current class signature to it. - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
