adding a docstring to an instancemethod

jelle jelleferinga at gmail.com
Wed Jul 25 07:05:37 EDT 2007


Hi,

I'm working on documenting wrapped C++ methods.
The thing is that I'd like to add docstrings to a method, but python
won't allow me to:
TypeError: attribute '__doc__' of 'instancemethod' objects is not
writable

What would be an easy way to do so? I'd like to overload the .__doc__,
rather than wrapping it in a class.

Cheers,

-jelle




More information about the Python-list mailing list