Boost logo

Boost :

From: John Max Skaller (skaller_at_[hidden])
Date: 2001-06-25 16:54:00


Karl MacMillan wrote:

> This approach works great when compiling for Python 2.0, but with Python
> 1.5.2, the category function is the same for all plugins that get imported
> (it's the category function from the first module that is imported.)
>
> ==== (Python session)
> >>> import plugina
> >>> plugina.category()
> 'CategoryA'
> >>> import pluginb
> >>> pluginb.category()
> 'CategoryA'
> ==== (New python session)
> >>> import pluginb
> >>> pluginb.category()
> 'CategoryB'
> >>> import plugina
> >>> plugina.category()
> 'CategoryB'
> ====

        Thats' really weird!
But I think the answer might be this:

      python::module_builder mPlugin("plugin");
      mPlugin.def(category, "category");

Seems like you named the modules 'plugin' in both
cases?? So the second import is not done,
since Python thinks it is already loaded.
[This is only a guess, since I don't know
how boost::python works]

-- 
John (Max) Skaller, mailto:skaller_at_[hidden] 
10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850
New generation programming language Felix  http://felix.sourceforge.net
Literate Programming tool Interscript     
http://Interscript.sourceforge.net

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