Skip to content

Commit fd25d8f

Browse files
committed
WIP: mv _obj property to NumpyDocString
1 parent fbdf433 commit fd25d8f

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

numpydoc/docscrape.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,16 @@ def _parse(self):
411411
else:
412412
self[section] = content
413413

414+
@property
415+
def _obj(self):
416+
if hasattr(self, '_cls'):
417+
return self._cls
418+
elif hasattr(self, '_f'):
419+
return self._f
420+
return None
421+
414422
def _error_location(self, msg, error=True):
415-
if hasattr(self, '_obj') and self._obj is not None:
423+
if self._obj is not None:
416424
# we know where the docs came from:
417425
try:
418426
filename = inspect.getsourcefile(self._obj)

numpydoc/docscrape_sphinx.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,6 @@ def _str_param_list(self, name, fake_autosummary=False):
229229

230230
return out
231231

232-
@property
233-
def _obj(self):
234-
if hasattr(self, '_cls'):
235-
return self._cls
236-
elif hasattr(self, '_f'):
237-
return self._f
238-
return None
239-
240232
def _str_member_list(self, name):
241233
"""
242234
Generate a member listing, autosummary:: table where possible,

0 commit comments

Comments
 (0)