diff --git a/jedi/api.py b/jedi/api.py index f0996fc5..2d3fbb3b 100644 --- a/jedi/api.py +++ b/jedi/api.py @@ -135,6 +135,14 @@ class Definition(dynamic.BaseOutput): @property def doc(self): """ 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: return str(self.definition.docstr) except AttributeError: