Re: [pygccxml-development] Py++ and docstrings for virtual method
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2011-03-14 19:10:41
|
On Mon, Mar 14, 2011 at 4:50 PM, Scott Sturdivant <sc...@bi...> wrote: > > Hi again py++ friends, Good evening > > I had a question concerning docstrings for virtual methods. For a normal method, my docstring extractor is working great, resulting in bindings that generate looking like this: > > .def( > "disableDebug" > , (void ( ::myManager::* )( ) )( &::myManager::disableDebug ) > , "disableDebug()\nDisable debug, returning the logging output to a sane level.") > > However, if the method is virtual, the generated wrapper looks more like this: > > .def( > "getFoo" > , (double ( ::myManager::* )( ) )(&::myManager::getFoo) > , (double ( myManager_wrapper::* )( ) )(&myManager_wrapper::default_getFoo) ); > > In the call to the actual wrapper, no where is my method's documentation present. Is this a limitation of py++, or of boost python? At the time, I implemented that feature, Boost.Python did not support docstring for them. What you can do is to generate a small Python module, with doc strings and inject them into the method: import foo foo.myManager.getFoo.__doc__ = <what ever> Than just ensure to import this module, right after the extension: http://www.boost.org/doc/libs/1_46_1/libs/python/doc/tutorial/doc/html/python/techniques.html#python.extending_wrapped_objects_in_python > Thanks! You are welcome. |