[C++-sig] reloading modules written with Boost.Python
David Cournapeau
david at ar.media.kyoto-u.ac.jp
Thu Sep 27 08:59:25 CEST 2007
François Duranleau wrote:
> On Wed, 26 Sep 2007, Christoph Groth wrote:
>
>
>> Dear group,
>>
>> I've created a simple module with Boost.Python which provides a single simple
>> function. Importing that module into python and executing the function works.
>>
>> It would be nice to be able to change the function, recompile the module, and
>> `reload(module_name)' it in python without restarting the interpreter. This,
>> however does not work. Python says it has reloaded the module but when I
>> execute the function it is still the old one:
>>
>
> AFAIK, it is a limitation of any extension modules, not just Boost.Python.
> Reloading works properly only with pure Python modules.
>
>
Couldn't it depends on the platform ? From an OS perspective, a C
extension is a dll/shared library, and not all OS can "deload" and
"reload" libraries in a running process ? Maybe python implementation
relies on the smallest common denominator ?
cheers,
David
More information about the Cplusplus-sig
mailing list