Re: [pygccxml-development] Default values for pointers?
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2006-03-22 11:26:18
|
On 3/22/06, Matthias Baas <ba...@ir...> wrote: > Hi, > > this is probably a general Boost.Python question but anyway... > > I have a couple of classes that have methods like the following: > > bool isDone(MStatus* ReturnStatus=3DNULL) const; > > The MStatus object is just used for error reporting. When the user > passes a MStatus object it will be filled with data specifying whether > an error has occurred or not, but the user can also decide not to pass > anything if he isn't interested in the error code. > pyplusplus generates the following code: > > MItDag_exposer.def( "isDone" > , &MItDag::isDone > , ( bp::arg("ReturnStatus")=3D0 ) > , bp::default_call_policies() ); > > The module compiles fine, I can use it, but why isn't the argument not > optional anymore? When I try to invoke the method without arguments I > get an error by Boost.Python: > > Boost.Python.ArgumentError: Python argument types in > MItDag.isDone(MItDag) > did not match C++ signature: > isDone(class MItDag {lvalue}, class MStatus * ReturnStatus=3D0) > > > Shouldn't the argument be optional as there is the "=3D0" in > bp::arg("ReturnStatus")=3D0? Or should pyplusplus generate some other cod= e? 1. I don't know 2. I will take a look what Pyste does 3. Can you try Google 4. boost.python - we always can ask for help there > - Matthias - Roman -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |