[Pyrex] declear opaque type
King C. Shu
kingshu at myrealbox.com
Fri May 2 03:21:10 CEST 2003
On Fri, May 02, 2003 at 11:39:17AM +1200, Michael JasonSmith wrote:
> On Fri, 2003-05-02 at 04:44, King C. Shu wrote:
> > Many libraries use opaque data type which are hidden from
> > the user. The attributes of the type might change between
> > versions. Can pyrex let peopel work on an opaque type?
> Yes. In fact, the only Pyrex module I ever wrote used an "opaque"
> type. See
> http://ldots.org/pyrex-guide/3-structures.html#external
> for an example of how to wrap an "opaque" structure.
Wow, this is great. Actually, I read your guide before
reading the pyrex's "Language Overview". I followed the
list at gmane for a few days until you annouced the update
of the quick guide... :) Thank you guys for the great work.
Anyway, you might consider to mention 'opaque' type or something
similar in the above part of the guide. Sometime an opaque type
might not be a struct but just a typedef which users don't want
to dig out off nested header files. :)
And export the opaque type will raise an error like:
Cannot convert 'Display (*)' to Python object
Yes, I know I said I don't need to expose an opaque type to
python or assign it to a python object. I just want to point
out that Python C API has a PyCObject which can wrap an
opaque C type.
Best regartd.
More information about the Pyrex
mailing list