How to override the doc of an object instance.

David Huard david.huard at
Wed Jun 21 18:04:15 CEST 2006


Although your solution works for the class itself, it doesn't for class
attributes, since they point to built-ins whose attributes are read-only. 

>>> w.x.__doc__ = widget.x.__doc__
AttributeError: 'int' object attribute '__doc__' is read-only

Would the solution be to build a new type and change its dict ?

More information about the Python-list mailing list