[Pyrex] C methods in extension types

Andreas Kostyrka andreas at mtg.co.at
Wed Oct 8 21:05:23 CEST 2003


Am Mi, den 08.10.2003 schrieb Francesc Alted um 18:21:
> A Dimecres 08 Octubre 2003 04:24, Greg Ewing va escriure:
> > I don't have a real-life example to hand, but I'll be making extensive
> 
> Well, I've made a try with a couple of extension types; the first one is
> defined, very succinctly, as:
> 
> cdef class Table:
> 
>   def _read_records(self, hsize_t start, hsize_t nrecords):
> 
> and I used to call this method from other extension class (in the same Pyrex
> file), in the form:
> 
> cdef class Row:
> 
>   def __new__(self, table):
>     self._table = table
> 
>   def __next__(self):
>        self.recout = self._table._read_records(self.nrowsread, 
def __next__(self):
    cdef Table mytab
    mytab = self._table
    self.recout = mytab._read_records(self.nrowsread, ...)

How's that?

Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://lists.copyleft.no/pipermail/pyrex/attachments/20031008/df6ee873/attachment.bin


More information about the Pyrex mailing list