[Pyrex] polymorphism with cdef methods

Jiba jiba at tuxfamily.org
Tue Dec 23 14:46:09 CET 2003


Hi again,

Polymorphism works with cdef methods (as explained in the documentation
overview->extension type->C methods), but it no longer works if the
class is defined in a .pxd file.

The two file bug.pyx and bug.pxd show this error.
bug.pyx is exactely the same as the "Parrot" example of the
documentation; and bug.pxd is a simple pxd file for these class.
When importing the module, the output is :

This parrot is resting.
This parrot is resting.

Though, if you remove the .pxd file, the output becomes :

This parrot is resting.
Lovely plumage!

Which is the correct output (as shown in the documentation).

PS i'm using Pyrex 0.9 with Python 2.3.2 on Mandrake Linux 9.2.

Jiba
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug.pxd
Type: application/octet-stream
Size: 65 bytes
Desc: not available
Url : http://lists.copyleft.no/pipermail/pyrex/attachments/20031223/f04888fc/bug.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug.pyx
Type: application/octet-stream
Size: 302 bytes
Desc: not available
Url : http://lists.copyleft.no/pipermail/pyrex/attachments/20031223/f04888fc/bug-0001.obj


More information about the Pyrex mailing list