[C++-sig] Calling import() multiple times for the same module

Robert Dailey rcdailey at gmail.com
Fri Oct 24 20:01:15 CEST 2008


Hi,

What happens if I do the following?

using namespace boost::python;

import( "__main__" ).attr( "new_global" ) = 40.0f;
import( "__main__" ).attr( "another_global" ) = 100.0f:


My main concern here is performance. I'm wondering if each call to
import() results in a disk query for the script in question and loads it
from there. I'm also wondering if the second import() above will simply
read from a memory cache or something.

Help would be appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20081024/b468d148/attachment.htm>


More information about the Cplusplus-sig mailing list