[C++-sig] Documentation error or too much newbie?

yakumoklesk at yahoo.es yakumoklesk at yahoo.es
Fri Sep 12 23:51:34 CEST 2003


In this page
http://www.boost.org/libs/python/doc/tutorial/doc/using_the_interpreter.html

there is a piece of code that i pasted into my main program after the Py_Initialize to test 
and learn the properties of boost.python objects:

handle<> main_module(borrowed( PyImport_AddModule("__main__") )); 
main_namespace dict(handle<>( borrowed( 	    
PyModule_GetDict(main_module.get()) ))); 

First of all I thought that the second line had an error: shouln't it be

dict main_namespace(...) instead of dict main_namespace(...)?

Because in the version that is in the page just does not compile, and the version I think it 
is correct at least compiles.

But when it arrives to the second line, I get an acces violation exception. What have I 
forgot?

David Lucena.

PD.- MSVC++ 6.0 in XP with _DEBUG, python 2.2.3 debug and boost.python 1.30.2 
debug







More information about the Cplusplus-sig mailing list