adding a docstring to an instancemethod

Gabriel Genellina gagsl-py2 at
Wed Jul 25 21:48:05 CEST 2007

En Wed, 25 Jul 2007 08:05:37 -0300, jelle <jelleferinga at>  

> 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

Set the __doc__ on the *function* from which you build the instance method.

Gabriel Genellina

More information about the Python-list mailing list