[Pyrex] C methods in extension types
Greg Ewing
greg at cosc.canterbury.ac.nz
Thu Oct 9 05:17:16 CEST 2003
Francesc Alted <falted at openlc.org>:
> A Dimecres 08 Octubre 2003 21:05, Andreas Kostyrka va escriure:
> >
> > def __next__(self):
> > cdef Table mytab
> > mytab = self._table
> > self.recout = mytab._read_records(self.nrowsread, ...)
> >
> > How's that?
>
> That works just fine... but why?
It works because the declaration of the local variable mytab
lets Pyrex know it's a table. But it's more efficient to
declare the attribute itself as a Table in the first place,
because Python attribute lookups will be used to access it
otherwise.
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury, | A citizen of NewZealandCorp, a |
Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. |
greg at cosc.canterbury.ac.nz +--------------------------------------+
More information about the Pyrex
mailing list