[C++-sig] what happened with this std::string parameter in boost.python

Donnie Leen Kingdom.Lin at yeah.net
Thu Dec 16 08:21:21 CET 2004


I made a program embedding boost.python, writting a module as following:

void write( std::string s )
{
	// do nothing
}
BOOST_PYTHON_MODULE(mym)
{
	def( "write", &write );
}


I run the python code:
import mym
s = 'hello'
mym.write(s)

it runs ok, but if i run the python code as following:
import mym
s = int.__doc__
mym.write(s)

it crashed, and it seems to crashed while boost.python try to delete the parameter s.
Can someone tell me what happened to it? Thanks first.


Donnie Leen






More information about the Cplusplus-sig mailing list