[C++-sig] Abstract class instances to-python conversion

Simon Warg simwarg at gmail.com
Mon Aug 1 13:19:46 CEST 2011


In My program I need to unload modules as well. What I do is remove all references to the particular module and it will be unloaded.

Are you using boost python for python 2 or 3? If it's the latter it is safe to use Py_Finalize()! I use it myself!

// Simon

On 1 aug 2011, at 12:58, Valentin Perrelle <valentin.perrelle at orange.fr> wrote:

> 
>> You could use the reload() function in python 2.7 or imp.reload() in python 3. It takes a module object as argument.
> Thanks. However it wouldn't reset to the initial state in the general case. All modules needs to be unloaded. I don't know a safe way to it yet. I'm just sure i want to do it in c++ not in Python.
> 
> I've just found that the call of Py_Finalize with Boost.Python is a known issue, already discussed on this mailing list and that the manual says not to call it : http://www.boost.org/doc/libs/1_47_0/libs/python/doc/tutorial/doc/html/python/embedding.html
> 
> _______________________________________________
> Cplusplus-sig mailing list
> Cplusplus-sig at python.org
> http://mail.python.org/mailman/listinfo/cplusplus-sig


More information about the Cplusplus-sig mailing list