Use Function.doc from api.Definition.doc
This commit is contained in:
1 parent
cffb3d2483
commit
cfd4bb6fc6
1 file changed
+8
@@ -135,6 +135,14 @@ class Definition(dynamic.BaseOutput):
|
|||||||
@property
|
@property
|
||||||
def doc(self):
|
def doc(self):
|
||||||
""" Returns the docstr, behaves like `Completion.doc`. """
|
""" Returns the docstr, behaves like `Completion.doc`. """
|
||||||
|
try:
|
||||||
|
return self.definition.doc
|
||||||
|
except AttributeError:
|
||||||
|
return self.raw_doc
|
||||||
|
|
||||||
|
@property
|
||||||
|
def raw_doc(self):
|
||||||
|
""" Returns the docstring `__doc__` for any object """
|
||||||
try:
|
try:
|
||||||
return str(self.definition.docstr)
|
return str(self.definition.docstr)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
|||||||
Reference in new issue
Block a user