Thanks for the suggestion, but unfortunately I get the error that the
attribute '__doc__' of 'instacemethod' objects is not writeable. No doubt
this is due to my constructor being private as the class is not to be
instantiated from python, only the methods are to be used.
I guess unless I change the ctor to be public, I'm stuck without
docstrings for virtual methods?
Thank you for your help,
On Mon, 14 Mar 2011, Roman Yakovenko wrote:
> On Mon, Mar 14, 2011 at 4:50 PM, Scott Sturdivant <scott@...> 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:
>> , (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:
>> , (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:
> You are welcome.