How is the document to access the resource?
I have a property with a docstring, but I cannot access it with help()
.
I tried the following two ways to access it:
class Mini(object):
@property
def t(self):
""" ahhhh """
return 0
x = Mini()
help(x.t)
class MiniNew(object):
t = property(doc='This is a doc')
y = MiniNew()
help(y.t)
The first one returned Help on int object: blahblahblah
, and the later one returned AttributeError: unreadable attribute
.
What is the correct way to access the property document?
+3
source to share
1 answer