[Pyrex] ANN: pyrexembed - Pyrex C++ wrapping kit

David McNab david at rebirthing.co.nz
Tue Nov 8 21:29:14 CET 2005


Hi again,

I've just released pyrexembed v0.1.1

It now allows the shim layer to be generated as a .c file or anything
one chooses (but the default remains as .cpp).

This extends pyrexembed's usefulness as a labour-saving tool when using
pyrex, since it supports writing of wrappers to C or C++, without
needing to create/maintain 'ctypedef' blocks in sync with the wrapped
code, or create/maintain 'cdef extern from' blocks in sync with the
imported functions.

Cheers
David


David McNab wrote:
> Lenard Lindstrom wrote:
> 
>>Pyrex already handles many aspects of C++. Here is the web site 
>>example written in pure Pyrex:
> 
> 
> ehh? where on the website is that?
> 
> 
>>cdef extern from "MyClass.h":
> 
> 8><
> 
> I assume this requires the C++ patch.
> 
> Anyway, after sleeping on pyrexembed, I'm now seeing that it could be
> used as a convenience system when wrapping plain C as well, since it
> eliminates the need to write and maintain 'cdef extern from' and
> 'ctypedef' blocks.
> 
> If I get a chance this evening, I'll update pyrexembed to allow users to
> specify generation of pure-C layer generation (with default staying as C++).
> 
> 
>>Of course 'pyrexembed' could simplify things when C++ exception traps 
>>must be written. I'm still not sure how best to do this.
> 
> 
> It does give a mechanism making it easy for users to access all of C++'s
> features, so until Pyrex gets full C++ support, pyrexembed will have
> some usefulness.
> 
> Cheers
> David
> 
> 
>>Lenard Lindstrom
>><len-l at telus.net>
>>
>>On 8 Nov 2005 at 18:36, David McNab wrote:
>>
>>
>>
>>>Hi all,
>>>
>>>Since Greg's commitments don't allow for him to implement C++ support in
>>>Pyrex any time soon, I've created an interim solution.
>>>
>>>It's called 'pyrexembed', a mechanism that allows you to embed C++ code
>>>directly into your Pyrex files, and end up with extensions that compile
>>>and work as expected.
>>>
>>>All is revealed on the website and in the tarball:
>>>
>>>  http://www.freenet.org.nz/python/pyrexembed
>>>
>>>Have fun with it.
>>>
>>>Patches, bug reports, feature requests, n-figure donations etc - all
>>>welcome, you've got my email.
>>
>>
>>
>>_______________________________________________
>>Pyrex mailing list
>>Pyrex at lists.copyleft.no
>>http://lists.copyleft.no/mailman/listinfo/pyrex
>>
>>
> 
> 
> _______________________________________________
> Pyrex mailing list
> Pyrex at lists.copyleft.no
> http://lists.copyleft.no/mailman/listinfo/pyrex
> 
> 



More information about the Pyrex mailing list