[Pyrex] Question about object creation

Greg Ewing greg at cosc.canterbury.ac.nz
Mon Aug 16 03:26:17 CEST 2004


Martin <msjogren at gmail.com>:

> Yes, from what you're saying it seems like I won't be able to do what
> I want, but this has little (probably nothing) to do with pyrex, and
> everything to do with how the new-style types work.

A trick you might consider is wrapping the X509_NAME in a PyCObject,
passing that to the extension type's constructor, and unwrapping it
inside the extension type's __new__ method. If you check carefully
enough, that would prevent Python code from being able to successfully
call the constructor, since it won't be able to manufacture the right
kind of PyCObject.

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