Boost logo

Boost :

From: Rainer Deyke (root_at_[hidden])
Date: 2001-08-12 00:09:25

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

> ----- Original Message -----
> From: "Rainer Deyke" <root_at_[hidden]>
> > Any Python extension module can create an arbitrary number of new Python
> > modules at arbitrary points in the code by simply calling the
> > functions of the Python extension API. If boost::python doesn't support
> > this, then that is a design flaw in boost::python.
> Hmm. I realize you can do that when statically linking to Python, but in
> extension module case, doesn't the name of the module init function have
> match the name of the shared library being loaded?

As I understand it, each .pyd file has a single entry point (called
'initXXXX' for file XXXX.pyd), but there is no restriction on how many
modules 'initXXXX' actually initializes. Of course, any other modules
initialized in 'initXXXX' won't actually exist until module 'XXXX' is
imported (and 'initXXXX' is called), but that's not really a problem if the
other modules are primarily accessed through module 'XXXX'.

I'm thinking of a C/C++ equivalent for the following Python module:

import new
import sys
sys.modules['XXXX.YYYY'] = YYYY = new.module('XXXX.YYYY')

Module 'XXXX' effectively becomes a package, despite being defined in a
single Python source file.

Rainer Deyke (root_at_[hidden])
Shareware computer games           - 
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor

Boost list run by bdawes at, gregod at, cpdaniel at, john at