Cpp + Python: static data dynamic initialization in *nix shared lib?

Dilip rdilipk at lycos.com
Tue Jul 13 16:47:48 EDT 2010


On Jul 13, 2:34 am, "Alf P. Steinbach /Usenet" <alf.p.steinbach
+use... at gmail.com> wrote:
> Well, we got no further, but I know of three solutions:
>
>    A) Punting: just say that the compiler has to support C++/C function type
>       mingling.
>       -> Perhaps the practical solution, but formally unsafe.
>
>    B) On the script side of things, delegate all calls to single Mother Of All
>       C func downcaller that supplies as extra arg an id of the C++ function.
>       -> Micro-level inefficient but easy to use and formally correct.
>
>    C) Let the user define the C linkage function wrappers via macros.
>       -> Efficient and formally correct but exposes ugly macro names.
>
> I chose (C).

Alf

This may or may not be what you are looking for but the middleware Ice
provides language mapping to enable Python to call into the Ice
libraries which are basically written in C++.  You can take a look at
this: http://www.zeroc.com/icepy.html

However that page may not be very descriptive.  The codebase, though,
is freely downloadable.  You can take a look at it if that will help
although you need to wade around a little bit to figure out what is
where.



More information about the Python-list mailing list