Boost python library

Rosbach, Hans A. Hans.A.Rosbach at dnv.com
Wed Jan 9 17:16:54 CET 2002


Dave,

> Hans,

> Firstly, unless I'm missing something, the code you sent me couldn't
> possibly compile. The only declaration of point::init is commented out,
yet
> you reference it in the geotest module's initialization function.

That was me missing something.  I have been modifying the code back
and forth between different cases, and pasted the wrong version, sorry.

> Secondly, you are treading in the hazy area of shared libraries (not
covered
> by the C++ standard) and the even hazier area of VC6, so all bets are off
> ;-)
>
> Third, your point's wrapper for the copy constructor reads:
> 
>          point_class.def(python::constructor<const point>());
> I think you want this to be a reference------^^^^^^^^^^^
> 

I had missed that one, but those types of typos are one reson I would
want to have it as close as possible.  Easier to spot.  The fact that
it is not necessary with boost.pyton to specify the arguments other
places, and make these mistakes is one of the features that makes me
like it.

> Fourth, however, I'm pretty sure none of those are your problem. Any given
> module may only  be exposed to one of the following:
>
>   class_builder<T,U>
>   import_converters<T>
>
> for any given T. Each one generates a set of conversion functions _when_
> _instantiated_ that is appropriate to whether T is exported from the
current
> module or not. If you declare both in the same translation unit, duplicate
> to_python/from_python functions with the same signature will be generated.
>

For a moment I thought I saw a solution, conditional compile, but (yet
at least) no such luck.  But then 

> HTH,
> Dave
>
> P.S. The rewrite will not have this limitation, as conversions will be
done
> in a much more cross-module-friendly manner. In fact, there will be no
need
> to declare import converters.

this looks promising.  Look forward to testing the rewrite.

Hans





**********************************************************************
Neither the confidentiality nor the integrity of this message 
can be guaranteed following transmission on the Internet. 
This message has been swept by MAILsweeper at DNV for 
the presence of computer viruses.
**********************************************************************



More information about the Cplusplus-sig mailing list