[C++-sig] [Py++] Missing struct

Roman Yakovenko roman.yakovenko at gmail.com
Mon Dec 14 20:31:52 CET 2009

On Mon, Dec 14, 2009 at 7:22 PM, Nikolaus Rath <Nikolaus at rath.org> wrote:
> No, but that's not what I'm saying. The only dependency here is printf,
> so Py++ should export do_smth, because it is from the main file, and
> printf from stdio.h, because do_smth depends on it.

Unfortunately, GCCXML doesn't provide information about function
implementation and arbitrary C/C++ expression. So Py++ can't see this

>> Py++ assumes, that files, that belongs to the same directory as the
>> file you pass, contain "interface", why all others contain
>> implementation.
> In my opinion that is not a particularly good assumption. Why not work
> without it and instead export all the dependencies of the file I'm
> passing?

Because what you think is good for you is actually bad for me( and
other users who already use Py++ ).

The assumption has a simple background( at least in my case ): in most
cases the project dependencies are bigger( more code ) than the
project itself. So it should be much easier to define what to export,
then the opposite. You can argue with this, but this is the current
default behavior and it is not going to change.

I understand that your use case is different than my - fine. I believe
Py++ has all functionality you need, to define what declarations
should be exported. Consider to use "reverse"logic:

mb = ctypes_module_builder_t( ... )
#and now define what you want to include

May be you should take a look on
"module_builder/ctypes_decl_dependencies.py" module. It contains
"find_out_dependencies" functionality. As input it takes a set of
declarations you want to expose, the output is a set of all classes,
that need to be exposed.


Roman Yakovenko
C++ Python language binding

More information about the Cplusplus-sig mailing list