diff options
Diffstat (limited to 'numpydoc/docscrape.py')
-rw-r--r-- | numpydoc/docscrape.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/numpydoc/docscrape.py b/numpydoc/docscrape.py index 150325f..317bdab 100644 --- a/numpydoc/docscrape.py +++ b/numpydoc/docscrape.py @@ -727,7 +727,15 @@ class ClassDoc(NumpyDocString): return True -def get_doc_object(obj, what=None, doc=None, config=None): +def get_doc_object( + obj, + what=None, + doc=None, + config=None, + class_doc=ClassDoc, + func_doc=FunctionDoc, + obj_doc=ObjDoc, +): if what is None: if inspect.isclass(obj): what = "class" @@ -741,10 +749,10 @@ def get_doc_object(obj, what=None, doc=None, config=None): config = {} if what == "class": - return ClassDoc(obj, func_doc=FunctionDoc, doc=doc, config=config) + return class_doc(obj, func_doc=func_doc, doc=doc, config=config) elif what in ("function", "method"): - return FunctionDoc(obj, doc=doc, config=config) + return func_doc(obj, doc=doc, config=config) else: if doc is None: doc = pydoc.getdoc(obj) - return ObjDoc(obj, doc, config=config) + return obj_doc(obj, doc, config=config) |