Boost logo

Boost :

From: Rainer Deyke (root_at_[hidden])
Date: 2001-08-11 15:04:32


----- Original Message -----
From: "David Abrahams" <david.abrahams_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Saturday, August 11, 2001 11:28 AM
Subject: Re: [boost] multiple boost::python modules in the same file

>
> ----- Original Message -----
> From: "Maximiliano Caceres" <maximiliano.caceres_at_[hidden]>
>
>
> >
> > Is there a way of defining multiple modules inside of the same
> > BOOST_PYTHON_MODULE_INIT function?
>
> I'm pretty sure there's no way to do that. You could ask the same question
> on the general python lists about 'C' extension modules. If there's no way
> to do it for regular extension modules, there's no way to do it with
> Boost.Python.

Any Python extension module can create an arbitrary number of new Python
modules at arbitrary points in the code by simply calling the appropriate
functions of the Python extension API. If boost::python doesn't support
this, then that is a design flaw in boost::python.

--
Rainer Deyke (root_at_[hidden])
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor
>
> > I'm currently "wrapping" a whole c++ framework into python, and I'd like
> to have
> > a single python import, but also I'd like to preserve some
namespace-like
> > structure inside python (using module names).
>
> Oh, that you can do. Just use the python package system. You'll still need
> to make separate C++ modules, though. If you only want one extension
module,
> just make a framework of Python modules which import the appropriate
> bindings from the single extension module.
>
> > I know it sounds a little strange, the idea is that I have a whole bunch
> of
> > DLLs, they will all be used in python almost at the same time, and I
don't
> want
> > to link boost::python in each one separately if I can do that just once.
>
> I can understand that. Making a Boost.Python DLL so that /all/ extension
> modules can share the common object code is a TODO item for the
development
> team.
>
> > So, if I call python::module_builder twice in the same
> BOOST_PYTHON_MODULE_INIT
> > I get an assertion.
> >
> > looking at cvsweb
> >
>
(http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/boost/boost/libs/python/src/
> modu
> > le_builder.cpp)
> > it looks like revision 1.2.6.1 (branch?) fixes this
> >
> > is this an official change? is anybody working on this? shall I get it
> from
> > cvs.sourceforge ?
>
> Uh, OK... I don't think that change was designed to do what you want, but
by
> all means, try it. I also thought that Ralf had integrated these changes
> into the main trunk long ago, but I could be wrong.
>
> -Dave
>
>
>
> Info: http://www.boost.org  Unsubscribe:
<mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk