[Pyrex] metaclasses for c extension types

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Aug 9 03:22:02 CEST 2005


Simon Burton wrote:

> I'm building a type system similar to ctypes: classes to represent c-level objects (int, void* etc).
> These classes need (among other things) a __getattr__ so i can write CInt.pointer to mean "int*".

You could try hacking the class's type pointer to point
to an appropriate subclass of type. Not sure if this
would have any undesirable side effects.

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+



More information about the Pyrex mailing list