[Pyrex] C methods in extension types

Greg Ewing greg at cosc.canterbury.ac.nz
Wed Oct 8 04:24:03 CEST 2003


Francesc Alted <falted at openlc.org>:

> I'm just curious about the advantages of having C methods in extension types
> that you recently introduced in pyrex 0.9. Would that mean they can be
> called from C code, for example?

Yes, in fact they can *only* be called from C code. They're designed
for the situation where you have substantial amounts of C computation
going on inside your Pyrex module which needs to operate on extension
types, and you don't want to incur the overhead of Python function
calls all over the place.

I don't have a real-life example to hand, but I'll be making extensive
use of them when I release the Pyrexified version of Plex that I got
half way through before realising that what I really wanted was C
methods...

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