[Pyrex] Problem subclassing extension types

Itamar Shtull-Trauring itamar at itamarst.org
Thu Jun 24 22:40:46 CEST 2004


I've got a tcp.pyx with a cdef class CProtocol and a corresponding
tcp.pxd for this class. sample.pyx does "cimport tcp" and tries to make
a "cdef class Sample(tcp.CProtocol)". pyrexc runs fine, but when
compiling:

sample.c:452: error: structure has no member named `__pyx_base'

The appropriate line is:

  __pyx_vtable_6sample_SampleProtocol.__pyx_base.cdataReceived = (void
*)__pyx_f_6sample_14SampleProtocol_cdataReceived;

which is:

static struct __pyx_vtabstruct_6sample_SampleProtocol
__pyx_vtable_6sample_SampleProtocol;

In the beginning of the file there is:
struct __pyx_obj_6sample_SampleProtocol {
  struct __pyx_obj_3tcp_CProtocol __pyx_base;
  struct __pyx_vtabstruct_6sample_SampleProtocol *__pyx_vtab;
  char (buf[100000]);
  char (*readbuf);
  int readlen;
  int counter;
};

struct __pyx_vtabstruct_6sample_SampleProtocol {
  void ((*lineReceived)(struct __pyx_obj_6sample_SampleProtocol *,char
(*),int ));
};
static struct __pyx_vtabstruct_6sample_SampleProtocol
*__pyx_vtabptr_6sample_SampleProtocol;

So indeed, there is no __pyx_base in this struct. Any ideas? Is this a
bug? 0.9.2.1 from Debian unstable, on powerpc.

-- 
Itamar Shtull-Trauring    http://itamarst.org






More information about the Pyrex mailing list