Skip to content

Commit b99e782

Browse files
committed
Proof-of-concept: Docstring attrs covered by refactor.
Running the test suite on this patch demonstrates that refactoring the boundary between NumpyDocString and SphinxDocString provides the necessary info to (potentially) do away with the validate.Docstring class.
1 parent fd25d8f commit b99e782

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

numpydoc/validate.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,12 @@ class Docstring:
126126
def __init__(self, name):
127127
self.name = name
128128
obj = self._load_obj(name)
129-
self.obj = obj
130-
self.code_obj = inspect.unwrap(obj)
131-
self.raw_doc = obj.__doc__ or ""
132-
self.clean_doc = pydoc.getdoc(obj)
133-
# self.doc = NumpyDocString(self.clean_doc)
134129
self.doc = get_doc_object(obj)
130+
self.obj = self.doc._obj
131+
self.code_obj = inspect.unwrap(self.obj)
132+
self.raw_doc = self.obj.__doc__ or ""
133+
self.clean_doc = pydoc.getdoc(self.obj)
134+
# self.doc = NumpyDocString(self.clean_doc)
135135

136136
@staticmethod
137137
def _load_obj(name):

0 commit comments

Comments
 (0)