How to override the doc of an object instance.
david.huard at gmail.com
Wed Jun 21 06:50:50 CEST 2006
I'm not really sure about the right terminology, but here is my question, boiled
down to this code:
class widget (object):
"""This is a widget."""
self._x = None
def fset(self, value):
self._x = value
print self._x, 'Ok'
x = property(fget = fget, fset = fset, doc= "It prints")
w = widget()
w.x = 5
I would like the last statement to print the doc string that I specified in
property, instead of the docstring for an int. The goal is to have ipython print
that string with the command
So the user knows what this attribute does, and how he can set it.
Is this possible ?
More information about the Python-list